liuyu 4 năm trước cách đây
mục cha
commit
ac9477fc18
1 tập tin đã thay đổi với 15 bổ sung21 xóa
  1. 15 21
      src/views/live/roomDetail.vue

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

@@ -443,37 +443,31 @@ export default {
       if (this.stremOtherlist.length > 0) {
         const swichstrem = _.find(this.stremOtherlist, { switchzjrid: switchzjr, type: 'other' });
         if (swichstrem) {
-          const oldstrem_ = _.find(this.stremlist, { type: 'mainr' });
-          if (oldstrem_) {
-            this.stermStop(oldstrem_.strem);
+          for (const oldstrem_ of this.stremlist) {
+            if (oldstrem_.type === 'mainr') {
+              this.stermStop(oldstrem_.strem);
+            }
           }
           this.stermPlay(swichstrem.strem, 'look-video-right');
         }
       }
     },
     async swichzbVideo(body) {
-      // 主持的场合
-      if (body.iszc === '0') {
-        const mainstrem_ = _.find(this.stremlist, { type: 'mainr' });
-        const newdatas = [];
-        if (mainstrem_) {
-          newdatas.push(mainstrem_);
-          this.$set(this, `stremlist`, newdatas);
-          this.stermStop(mainstrem_.strem);
-          this.stermPlay(mainstrem_.strem, 'look-video-right');
-        }
-      } else {
-        // 主讲
-        const othestrem_ = _.find(this.stremOtherlist, { switchzjrid: switchzjr, type: 'other' });
+      //
+      const mainstrem_ = _.find(this.stremlist, { type: 'mainr' });
+      const newdatas = [];
+      if (body.switchzjr) {
+        const othestrem_ = _.find(this.stremOtherlist, { switchzjrid: body.switchzjr, type: 'other' });
         if (othestrem_) {
-          const mainstrem_ = _.find(this.stremlist, { type: 'mainr' });
-          if (mainstrem_) {
-            this.stermStop(mainstrem_.strem);
-          }
           this.stermStop(othestrem_.strem);
-          this.stermPlay(othestrem_.strem, 'look-video-right');
         }
       }
+      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);