liuyu 4 年 前
コミット
8e1b7aa3ac
1 ファイル変更19 行追加12 行削除
  1. 19 12
      src/views/live/roomDetail.vue

+ 19 - 12
src/views/live/roomDetail.vue

@@ -423,7 +423,7 @@ export default {
       if (body) {
         body = JSON.parse(body);
         this.swichzjrstatus = false;
-        this.swichzbVideo(body.switchzjr);
+        this.swichzbVideo(body);
       }
     },
     onOtheMessage(message) {
@@ -451,22 +451,29 @@ export default {
         }
       }
     },
-    async swichzbVideo(switchzjr) {
-      //
-      const mainstrem_ = _.find(this.stremlist, { type: 'mainr' });
-      const newdatas = [];
-      if (switchzjr) {
+    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' });
         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);