liuyu 4 years ago
parent
commit
e6a2dff906
1 changed files with 17 additions and 8 deletions
  1. 17 8
      src/views/live/roomDetail.vue

+ 17 - 8
src/views/live/roomDetail.vue

@@ -496,22 +496,31 @@ export default {
       //
       const mainstrem_ = _.find(this.stremlist, { type: 'mainr' });
       const newdatas = [];
-      if (body.switchzjr) {
-        const othestrem_ = _.find(this.stremOtherlist, { switchzjrid: body.switchzjr, type: 'other' });
-        if (othestrem_) {
-          this.stermStop(othestrem_.strem);
+      console.log('切换主持人--' + body.switchzjr);
+      // if (body.switchzjr) {
+      //   // const othestrem_ = _.find(this.stremOtherlist, { switchzjrid: body.switchzjr, type: 'other' });
+      //   // if (othestrem_) {
+      //   //   this.stermStop(othestrem_.strem);
+      //   // }
+
+      // } else {
+
+      // }
+      for (const elm of this.stremOtherlist) {
+        if (elm) {
+          this.stermStop(elm.strem);
         }
       }
+      const sharestrem_ = _.find(this.stremlist, { type: 'share' });
+      if (sharestrem_) {
+        this.stermStop(sharestrem_.strem);
+      }
       if (mainstrem_) {
         newdatas.push(mainstrem_);
         this.$set(this, `stremlist`, newdatas);
         this.stermStop(mainstrem_.strem);
         this.stermPlay(mainstrem_.strem, 'look-video-right');
       }
-      const sharestrem_ = _.find(this.stremlist, { type: 'share' });
-      if (sharestrem_) {
-        this.stermStop(sharestrem_.strem);
-      }
     },
     async userswichrole() {
       // 根据房间id查询房间详细信息