liuyu 4 tahun lalu
induk
melakukan
a0e5c64132
1 mengubah file dengan 30 tambahan dan 15 penghapusan
  1. 30 15
      src/views/live/roomDetail.vue

+ 30 - 15
src/views/live/roomDetail.vue

@@ -614,7 +614,18 @@ export default {
           if (useridsplit_ === 'share') {
             console.log('进入分享模式' + useridsplit_);
             const newdata_ = { strem: remoteStream, type: 'share' };
-            this.stremlist.push(newdata_);
+            const sharestrem_ = _.find(this.stremlist, { type: 'share' });
+            if (sharestrem_) {
+              const newdatas = [];
+              newdatas.push(newdata_);
+              const mainstrem_ = _.find(this.stremlist, { type: 'mainr' });
+              if (mainstrem_) {
+                newdatas.push(mainstrem_);
+              }
+              this.$set(this, `stremlist`, newdatas);
+            } else {
+              this.stremlist.push(newdata_);
+            }
             this.lvideoid_ = 'video_' + remoteStream.getId();
             //this.zbfpbtn();
             this.swichposition();
@@ -646,10 +657,10 @@ export default {
             const mainstrem_ = _.find(this.stremlist, { type: 'mainr' });
             if (mainstrem_) {
               const newdatas = [];
-              datas.push(newdata_);
+              newdatas.push(newdata_);
               const sharestrem_ = _.find(this.stremlist, { type: 'share' });
               if (sharestrem_) {
-                datas.push(sharestrem_);
+                newdatas.push(sharestrem_);
               }
               this.$set(this, `stremlist`, newdatas);
             } else {
@@ -659,20 +670,22 @@ export default {
               const swichstrem = _.find(this.stremOtherlist, { switchzjrid: this.swichzjrid, type: 'other' });
               if (swichstrem) {
                 this.stermStop(swichstrem.strem);
+                this.stermPlay(swichstrem.strem, 'look-video-right');
               }
+            } else {
+              remoteStream
+                .play('look-video-right')
+                .then(() => {
+                  // autoplay success
+                })
+                .catch(e => {
+                  const errorCode = e.getCode();
+                  if (errorCode === 0x4043) {
+                    // PLAY_NOT_ALLOWED,引导用户手势操作恢复音视频播放
+                    remoteStream.resume();
+                  }
+                });
             }
-            remoteStream
-              .play('look-video-right')
-              .then(() => {
-                // autoplay success
-              })
-              .catch(e => {
-                const errorCode = e.getCode();
-                if (errorCode === 0x4043) {
-                  // PLAY_NOT_ALLOWED,引导用户手势操作恢复音视频播放
-                  remoteStream.resume();
-                }
-              });
           } else if (useridsplit_ === 'other') {
             console.log('333');
             this.rvideoid_ = 'video_' + remoteStream.getId();
@@ -776,6 +789,7 @@ export default {
         this.transform = 'rotate(90deg)';
         // this.vwidth = height;
         console.log(height);
+        console.log('this.othedivshow---' + this.othedivshow);
         if (this.othedivshow) {
           this.vheight = `${width - 70}px`;
           this.vwidth = `${height}px`;
@@ -786,6 +800,7 @@ export default {
           this.vwidth = `${height}px`;
           this.lheight = `${width}px`;
           this.rheight = `${width}px`;
+          this.otheheight = '0px';
         }
 
         this.btop = `${height - 40}px`;