liuyu 5 年之前
父節點
當前提交
20fa4c6a49
共有 1 個文件被更改,包括 6 次插入1 次删除
  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_);