liuyu 4 jaren geleden
bovenliggende
commit
5d4af963ab
1 gewijzigde bestanden met toevoegingen van 8 en 4 verwijderingen
  1. 8 4
      src/views/live/roomDetail.vue

+ 8 - 4
src/views/live/roomDetail.vue

@@ -9,7 +9,7 @@
         <div id="look-video-right" :style="{ height: rheight, width: rwidth }" class="video-box col-div look-video-right"></div>
         <div id="look-video-right" :style="{ height: rheight, width: rwidth }" class="video-box col-div look-video-right"></div>
       </div>
       </div>
       <div id="othediv" v-show="othedivshow" :style="{ transform: transform, height: otheheight, width: vwidth, padding: othepadding, position: 'absolute' }">
       <div id="othediv" v-show="othedivshow" :style="{ transform: transform, height: otheheight, width: vwidth, padding: othepadding, position: 'absolute' }">
-        <div :style="{ height: otheheight, width: vwidth, background: background_ }">
+        <div id="otheplaydiv" :style="{ height: otheheight, width: vwidth, background: background_ }">
           <div id="othe-video-1" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
           <div id="othe-video-1" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
           <div id="othe-video-2" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
           <div id="othe-video-2" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
           <div id="othe-video-3" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
           <div id="othe-video-3" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
@@ -451,8 +451,12 @@ export default {
       // publish the local stream
       // publish the local stream
       await this.client_.publish(this.localStream_);
       await this.client_.publish(this.localStream_);
       this.index_ = this.index_ + 1;
       this.index_ = this.index_ + 1;
+
       if (this.index_ < 6) {
       if (this.index_ < 6) {
+        // const otheplaydiv = document.getElementById('otheplaydiv');
         const id_ = 'othe-video-' + this.index_;
         const id_ = 'othe-video-' + this.index_;
+        // const newdiv = '<div id="' + id_ + '" style="height: 70px, width: 20%" class="video-box col-div othe-video-left"></div>';
+        // otheplaydiv.appendChild(newdiv);
         console.log(id_);
         console.log(id_);
         this.localStream_.play(id_);
         this.localStream_.play(id_);
       }
       }
@@ -543,6 +547,7 @@ export default {
           const userid_ = remoteStream.getUserId();
           const userid_ = remoteStream.getUserId();
           const res_ = userid_.indexOf('-');
           const res_ = userid_.indexOf('-');
           const useridsplit_ = userid_.substring(0, 5);
           const useridsplit_ = userid_.substring(0, 5);
+          const userid_zs = userid_.substring(5);
           console.log('222--->' + useridsplit_);
           console.log('222--->' + useridsplit_);
           if (useridsplit_ === 'share') {
           if (useridsplit_ === 'share') {
             console.log('进入分享模式' + useridsplit_);
             console.log('进入分享模式' + useridsplit_);
@@ -607,10 +612,9 @@ export default {
             if (this.index_ < 6) {
             if (this.index_ < 6) {
               const id_ = 'othe-video-' + this.index_;
               const id_ = 'othe-video-' + this.index_;
               console.log(id_);
               console.log(id_);
-              const swichuserid = useridsplit_.substring(1);
-              const newdata = { swichuserid: useridsplit_.substring(1), swichindex: this.index_ };
+              const newdata = { swichuserid: this.userid_zs, swichindex: this.index_ };
               this.swichusers.push(newdata);
               this.swichusers.push(newdata);
-              if (this.user.uid === useridsplit_.substring(1)) {
+              if (this.user.uid === this.userid_zs) {
                 this.userindex_ = this.index_;
                 this.userindex_ = this.index_;
               }
               }
               remoteStream.play(id_);
               remoteStream.play(id_);