소스 검색

fix(conference): start camera later on

Instead of disabling the video button in the toolbar, mark it as muted,
so that the user can click it to try enable video later on, even if
joined without video (either declined permission or was starting with
screen streaming and dismissed the dialog).
master
paweldomas 8 년 전
부모
커밋
d84ab20a47
1개의 변경된 파일21개의 추가작업 그리고 5개의 파일을 삭제
  1. 21
    5
      conference.js

+ 21
- 5
conference.js 파일 보기

613
                 }
613
                 }
614
 
614
 
615
                 if (!tracks.find((t) => t.isVideoTrack())) {
615
                 if (!tracks.find((t) => t.isVideoTrack())) {
616
-                    APP.UI.setCameraButtonEnabled(false);
616
+                    // Instead of disabling the button we want to show button
617
+                    // muted, so that the user can have the opportunity to add
618
+                    // the video later on, even if joined without it.
619
+                    this.videoMuted = true;
620
+                    APP.UI.setVideoMuted(this.getMyUserId(), this.videoMuted);
617
                 }
621
                 }
618
 
622
 
619
                 this._initDeviceList();
623
                 this._initDeviceList();
1036
                     newStream.videoType === 'camera'
1040
                     newStream.videoType === 'camera'
1037
                         && APP.UI.setCameraButtonEnabled(true);
1041
                         && APP.UI.setCameraButtonEnabled(true);
1038
                 } else {
1042
                 } else {
1039
-                    this.videoMuted = false;
1043
+                    // No video is treated the same way as being video muted
1044
+                    this.videoMuted = true;
1040
                     this.isSharingScreen = false;
1045
                     this.isSharingScreen = false;
1041
                 }
1046
                 }
1042
                 APP.UI.setVideoMuted(this.getMyUserId(), this.videoMuted);
1047
                 APP.UI.setVideoMuted(this.getMyUserId(), this.videoMuted);
1543
         APP.UI.addListener(UIEvents.VIDEO_MUTED, muted => {
1548
         APP.UI.addListener(UIEvents.VIDEO_MUTED, muted => {
1544
             if (this.isAudioOnly() && !muted) {
1549
             if (this.isAudioOnly() && !muted) {
1545
                 this._displayAudioOnlyTooltip('videoMute');
1550
                 this._displayAudioOnlyTooltip('videoMute');
1546
-                return;
1551
+            } else if (!localVideo && this.videoMuted && !muted) {
1552
+                // Maybe try to create local video if there wasn't any ?
1553
+                // This handles the case when user joined with no video
1554
+                // (dismissed screen sharing screen), but decided to add it
1555
+                // later on by clicking on muted video icon.
1556
+                createLocalTracks({ devices: ['video'] }, false)
1557
+                    .then(([videoTrack]) => {
1558
+                        APP.conference.useVideoStream(videoTrack);
1559
+                    })
1560
+                    .catch(error => {
1561
+                        APP.UI.showDeviceErrorDialog(null, error);
1562
+                    });
1563
+            } else {
1564
+                muteLocalVideo(muted);
1547
             }
1565
             }
1548
-
1549
-            muteLocalVideo(muted);
1550
         });
1566
         });
1551
 
1567
 
1552
         room.on(ConnectionQualityEvents.LOCAL_STATS_UPDATED,
1568
         room.on(ConnectionQualityEvents.LOCAL_STATS_UPDATED,

Loading…
취소
저장