guhongwei 4 år sedan
förälder
incheckning
39007bfc4b
1 ändrade filer med 16 tillägg och 13 borttagningar
  1. 16 13
      src/views/live/parts/roomsDetail.vue

+ 16 - 13
src/views/live/parts/roomsDetail.vue

@@ -4,11 +4,11 @@
       <el-col :span="24" class="info">
         <el-col :span="24" class="video">
           <el-col :span="24" class="videoLeft">
-            <div id="look-video" class="video-box col-div" style="justify-content: flex-end"></div>
+            <div id="look-video-left" class="video-box col-div" style="justify-content: flex-end"></div>
+          </el-col>
+          <el-col :span="9" class="videoRight">
+            <div id="look-video-right" class="video-box col-div" style="justify-content: flex-end"></div>
           </el-col>
-          <!-- <el-col :span="9" class="videoRight">
-            右侧
-          </el-col> -->
         </el-col>
         <el-col :span="24" class="chat">
           <el-col :span="24" class="chatList">
@@ -67,14 +67,17 @@ export default {
         this.client_.on('stream-subscribed', event => {
           const remoteStream = event.stream;
           // 远端流订阅成功,播放远端音视频流
-          remoteStream.setVideoProfile({ width: '50%', height: 200, float: 'left', frameRate: 15, bitrate: 900 /* kpbs */ });
-          remoteStream.play('look-video');
+          console.log(remoteStream.getType());
+          if (remoteStream.getType() === 'main') {
+            remoteStream.play('look-video-right');
+          } else {
+            remoteStream.play('look-video-left');
+          }
         });
         // 监听远端流增加事件
         this.client_.on('stream-added', event => {
           const remoteStream = event.stream;
           // 订阅远端音频和视频流
-          remoteStream.setScreenProfile({ width: '50%', height: 200, float: 'left', frameRate: 5, bitrate: 1600 /* kbps */ });
           this.client_.subscribe(remoteStream, { audio: false, video: true }).catch(e => {
             console.error('failed to subscribe remoteStream');
           });
@@ -142,14 +145,14 @@ export default {
   height: 190px !important;
   border-radius: 10px;
 }
-#look-video {
-  float: left;
+#look-video-left {
+  width: 100%;
+  height: 200px;
+  grid-area: 1/1/3/4;
+}
+#look-video-right {
   width: 100%;
   height: 200px;
   grid-area: 1/1/3/4;
-  div {
-    float: left;
-    width: 50%;
-  }
 }
 </style>