liuyu 5 năm trước cách đây
mục cha
commit
20fa4c6a49
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      src/views/live/roomDetail.vue

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

@@ -348,7 +348,7 @@ export default {
         if (body.switchrole === 'anchor' && body.userid === this.user.uid) {
           this.switchbtn = true;
           this.switchmeetbtn = true;
-          //this.roomMeetBtn();
+          this.roomMeetSwich();
         } else {
           this.switchbtn = false;
         }
@@ -399,6 +399,9 @@ export default {
             videoTrack.stop();
             this.client_.unpublish(this.localStream_).then(() => {
               // 取消发布本地流成功
+              if (this.index_ > 0) {
+                this.index_ = this.index_ - 1;
+              }
             });
           });
         }
@@ -420,6 +423,8 @@ export default {
         await this.client_.publish(this.localStream_);
         this.index_ = this.index_ + 1;
         if (this.index_ < 6) {
+          const newdata = { swichuserid: this.userId_, swichindex: this.index_ };
+          this.swichusers.push(newdata);
           const id_ = 'othe-video-' + this.index_;
           console.log(id_);
           this.localStream_.play(id_);