liuyu 4 years ago
parent
commit
1787f028c5
1 changed files with 23 additions and 26 deletions
  1. 23 26
      src/views/live/roomDetail.vue

+ 23 - 26
src/views/live/roomDetail.vue

@@ -251,6 +251,7 @@ export default {
           }
         }
       } else {
+        console.log('share--' + this.othedivshow);
         if (this.othedivshow) {
           for (const i = 1; i < 6; i++) {
             const id_ = 'othe-video-' + i;
@@ -264,19 +265,11 @@ export default {
             thr_.style.cssText = style;
           }
         }
-        const transformid_ = document.getElementById('transformid');
-        let style = 'width:' + width + 'px;';
-        style += 'height: 200px;';
-        transformid_.style.cssText = style;
-        this.transform = 'rotate(0deg)';
-        // this.vwidth = height;
-        this.vheight = `200px`;
-        this.vwidth = `${width}px`;
-        this.lheight = `200px`;
-        this.rheight = `200px`;
-
-        this.btop = `167px`;
-        this.bright = `10px`;
+        console.log('share设置大小--');
+        const lvl_ = document.getElementById('look-video-left');
+        let stylell = 'width:70%;';
+        stylell += 'height:200px;';
+        lvl_.style.cssText = stylell;
       }
       const lvr_ = document.getElementById('look-video-right');
       let stylel = 'width:30%;';
@@ -396,9 +389,9 @@ export default {
               console.log('remove video call success');
               // 关闭摄像头
               videoTrack.stop();
-              this.client_.unpublish(this.localStream_).then(() => {
-                // 取消发布本地流成功
-              });
+              // this.client_.unpublish(this.localStream_).then(() => {
+              //   // 取消发布本地流成功
+              // });
             });
           }
         }
@@ -552,19 +545,21 @@ export default {
           const useridsplit_ = userid_.substring(0, 5);
           console.log('222--->' + useridsplit_);
           if (useridsplit_ === 'share') {
+            console.log('进入分享模式' + useridsplit_);
             this.lvideoid_ = 'video_' + remoteStream.getId();
             //this.zbfpbtn();
             this.swichposition();
-            // this.othedivshow = false;
-            // this.oheight = '200px';
-            // this.otheheight = '1px';
+            this.othedivshow = false;
+            this.oheight = '200px';
+            this.otheheight = '1px';
+            console.log('进入分享模式' + this.lvideoid_);
             remoteStream
               .play('look-video-left')
               .then(() => {
                 // autoplay success
                 // 播放成功时调用css属性
                 const _lvideoid_ = document.getElementById(this.lvideoid_);
-                const style = 'width: 100%; height: 100%; position: absolute; transform: rotateY(0); object-fit: fill';
+                const style = 'width: 100%; height: 200px; position: absolute; transform: rotateY(0); object-fit: fill';
                 _lvideoid_.style.cssText = style;
               })
               .catch(e => {
@@ -643,12 +638,14 @@ export default {
           const remoteStream = event.stream;
           console.log('stop----');
           const userid_ = remoteStream.getUserId();
-          const useridsplit_ = userid_.substring(0, 5);
-          if (useridsplit_ === 'wxxcx' || useridsplit_ === 'meetu') {
-            console.log('退出userid_' + useridsplit_);
-            // 订阅远端音频和视频流
-            if (this.index_ > 0) {
-              this.index_ = this.index_ - 1;
+          if (userid_) {
+            const useridsplit_ = userid_.substring(0, 5);
+            if (useridsplit_ === 'wxxcx' || useridsplit_ === 'meetu') {
+              console.log('退出userid_' + useridsplit_);
+              // 订阅远端音频和视频流
+              if (this.index_ > 0) {
+                this.index_ = this.index_ - 1;
+              }
             }
           }
           remoteStream.stop();