liuyu 4 vuotta sitten
vanhempi
commit
dbfd270aa8
2 muutettua tiedostoa jossa 10 lisäystä ja 3 poistoa
  1. 1 1
      src/views/live/roomDetail.vue
  2. 9 2
      src/views/live/roomMeet.vue

+ 1 - 1
src/views/live/roomDetail.vue

@@ -148,7 +148,7 @@ export default {
       let data = {};
       data.roomid = this.id;
       data.roomname = this.roomname;
-      data.userid = this.user.userid === null ? '111' : this.user.userid;
+      data.userid = this.user.userid;
       data.username = this.user.name;
       const res = await this.lookuserFetch(data);
       // 根据房间id查询房间详细信息

+ 9 - 2
src/views/live/roomMeet.vue

@@ -97,7 +97,7 @@ export default {
       activeName: 'first',
       iscamera: false,
       typevalue: 'warning',
-      index: 0,
+      index: 1,
     };
   },
   created() {
@@ -211,6 +211,14 @@ export default {
             console.error('failed to subscribe remoteStream');
           });
         });
+        this.client_.on('mute-video', event => {
+          const remoteStream = event.stream;
+          // 订阅远端音频和视频流
+          if (this.index > 1) {
+            this.index = this.index - 1;
+          }
+          console.log('333--index---->' + this.index);
+        });
       }
     },
     async liveon() {
@@ -223,7 +231,6 @@ export default {
             videoTrack.stop();
             this.client_.unpublish(this.localStream_).then(() => {
               // 取消发布本地流成功
-              this.index = this.index - 1;
             });
           });
         }