liuyu 4 年之前
父節點
當前提交
6c51a793e7
共有 1 個文件被更改,包括 43 次插入0 次删除
  1. 43 0
      src/views/live/roomDetail.vue

+ 43 - 0
src/views/live/roomDetail.vue

@@ -669,11 +669,25 @@ export default {
             } else {
             } else {
               this.stremlist.push(newdata_);
               this.stremlist.push(newdata_);
             }
             }
+            console.log('this.swichzjrid---' + this.swichzjrid);
             if (this.swichzjrid) {
             if (this.swichzjrid) {
               const swichstrem = _.find(this.stremOtherlist, { switchzjrid: this.swichzjrid, type: 'other' });
               const swichstrem = _.find(this.stremOtherlist, { switchzjrid: this.swichzjrid, type: 'other' });
               if (swichstrem) {
               if (swichstrem) {
                 this.stermStop(swichstrem.strem);
                 this.stermStop(swichstrem.strem);
                 this.stermPlay(swichstrem.strem, 'look-video-right');
                 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();
+                    }
+                  });
               }
               }
             } else {
             } else {
               remoteStream
               remoteStream
@@ -738,15 +752,44 @@ export default {
         this.client_.on('stream-removed', event => {
         this.client_.on('stream-removed', event => {
           const remoteStream = event.stream;
           const remoteStream = event.stream;
           console.log('stop----');
           console.log('stop----');
+          console.log(event);
           if (remoteStream) {
           if (remoteStream) {
             const userid_ = remoteStream.getUserId();
             const userid_ = remoteStream.getUserId();
             const useridsplit_ = userid_.substring(0, 5);
             const useridsplit_ = userid_.substring(0, 5);
+            const userid_zs = userid_.substring(6);
+            console.log(useridsplit_);
             if (useridsplit_ === 'wxxcx' || useridsplit_ === 'meetu') {
             if (useridsplit_ === 'wxxcx' || useridsplit_ === 'meetu') {
               console.log('退出userid_' + useridsplit_);
               console.log('退出userid_' + useridsplit_);
               // 订阅远端音频和视频流
               // 订阅远端音频和视频流
               if (this.index_ > 0) {
               if (this.index_ > 0) {
                 this.index_ = this.index_ - 1;
                 this.index_ = this.index_ - 1;
               }
               }
+              const newdatas = [];
+              for (const elm of this.stremMeetlist) {
+                if (elm.swichuserid !== userid_zs) {
+                  newdatas.push(elm);
+                }
+              }
+              this.$set(this, `stremMeetlist`, newdatas);
+            } else if (useridsplit_ === 'share') {
+              const newdatas = [];
+              for (const elm of this.stremlist) {
+                if (elm.type !== 'share') {
+                  newdatas.push(elm);
+                }
+              }
+              this.$set(this, `stremlist`, newdatas);
+            } else if (useridsplit_ === 'mainr') {
+              const newdatas = [];
+              this.$set(this, `stremlist`, newdatas);
+            } else if (useridsplit_ === 'other') {
+              const newdatas = [];
+              for (const elm of this.stremOtherlist) {
+                if (elm.switchzjrid !== userid_zs) {
+                  newdatas.push(elm);
+                }
+              }
+              this.$set(this, `stremOtherlist`, newdatas);
             }
             }
           }
           }
           remoteStream.stop();
           remoteStream.stop();