liuyu há 4 anos atrás
pai
commit
ba8715dc70
1 ficheiros alterados com 4 adições e 1 exclusões
  1. 4 1
      src/views/live/parts/roomsDetail.vue

+ 4 - 1
src/views/live/parts/roomsDetail.vue

@@ -62,16 +62,19 @@ export default {
           userId: this.userId_,
           userSig: res.data,
         });
-        await this.client_.join({ roomId: this.roomname, role: 'anchor' });
+        await this.client_.join({ roomId: this.roomname, role: 'audience' });
+        this.client_.set
         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');
         });
         // 监听远端流增加事件
         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');
           });