dusenyao 3 år sedan
förälder
incheckning
980e2a3ea7
2 ändrade filer med 4 tillägg och 9 borttagningar
  1. 2 3
      src/views/live/student/index.vue
  2. 2 6
      src/views/live/student/live.js

+ 2 - 3
src/views/live/student/index.vue

@@ -31,9 +31,9 @@
           </div>
         </div>
         <div v-show="connect" class="student-parent">
-          <div v-show="roomInfo.video_mode === 1 || remoteStreamType === 1" id="student"></div>
+          <div v-show="roomInfo.video_mode === 1" id="student"></div>
 
-          <template v-if="remoteStreamType !== 1">
+          <template v-if="invite">
             <template v-if="roomInfo.video_mode === 1">
               <el-button v-show="invite" type="danger" @click="handsDown">
                 <svg-icon icon-class="hang-up" /> 挂断
@@ -179,7 +179,6 @@ export default {
       // 定时器
       timer: null,
       timer_group: null,
-      remoteStreamType: -1,
       rtc: null,
       roomData: {
         desc: '直播间标题',

+ 2 - 6
src/views/live/student/live.js

@@ -134,7 +134,6 @@ export function initListener(vue) {
         success(stream) {
           // 订阅流成功
           let streamType = stream.streamType();
-          vue.remoteStreamType = streamType;
           console.log('订阅流成功', streamType);
           let id = streamType === 0 ? 'live' : 'student';
           stream.show(id, 'contain'); // 将流显示到指定 id 的盒子中
@@ -227,11 +226,8 @@ export function initListener(vue) {
   // 监听通知移除流事件
   rtc.on('stream_removed', stream => {
     console.log('监听通知移除流事件', stream);
-    if (stream.streamType() === 10) {
-      vue.connect = false;
-      vue.remoteStreamType = -1;
-    }
-    if (stream.streamType() === 1) {
+    let streamType = stream.streamType();
+    if (streamType === 10 || streamType === 1) {
       vue.connect = false;
     }
   });