瀏覽代碼

ref(local-audio): remove rendering of local audio

The local audio stream is attached to an audio element that is
always muted. As such, local audio is not being rendered and
the attaching may just not be needed at all.
master
Leonard Kim 8 年之前
父節點
當前提交
16fbf90a00
共有 3 個檔案被更改,包括 2 行新增23 行删除
  1. 2
    1
      modules/UI/UI.js
  2. 0
    4
      modules/UI/videolayout/LocalVideo.js
  3. 0
    18
      modules/UI/videolayout/VideoLayout.js

+ 2
- 1
modules/UI/UI.js 查看文件

366
 UI.addLocalStream = track => {
366
 UI.addLocalStream = track => {
367
     switch (track.getType()) {
367
     switch (track.getType()) {
368
     case 'audio':
368
     case 'audio':
369
-        VideoLayout.changeLocalAudio(track);
369
+        // Local audio is not rendered so no further action is needed at this
370
+        // point.
370
         break;
371
         break;
371
     case 'video':
372
     case 'video':
372
         VideoLayout.changeLocalVideo(track);
373
         VideoLayout.changeLocalVideo(track);

+ 0
- 4
modules/UI/videolayout/LocalVideo.js 查看文件

57
     containerSpan.innerHTML = `
57
     containerSpan.innerHTML = `
58
         <div class = 'videocontainer__background'></div>
58
         <div class = 'videocontainer__background'></div>
59
         <span id = 'localVideoWrapper'></span>
59
         <span id = 'localVideoWrapper'></span>
60
-        <audio
61
-            autoplay = true
62
-            id = 'localAudio'
63
-            muted = true></audio>
64
         <div class = 'videocontainer__toolbar'></div>
60
         <div class = 'videocontainer__toolbar'></div>
65
         <div class = 'videocontainer__toptoolbar'></div>
61
         <div class = 'videocontainer__toptoolbar'></div>
66
         <div class = 'videocontainer__hoverOverlay'></div>
62
         <div class = 'videocontainer__hoverOverlay'></div>

+ 0
- 18
modules/UI/videolayout/VideoLayout.js 查看文件

170
             largeVideo.updateLargeVideoAudioLevel(lvl);
170
             largeVideo.updateLargeVideoAudioLevel(lvl);
171
     },
171
     },
172
 
172
 
173
-    changeLocalAudio (stream) {
174
-        let localAudio = document.getElementById('localAudio');
175
-        localAudio = stream.attach(localAudio);
176
-
177
-        // Now when Temasys plugin is converting also <audio> elements to
178
-        // plugin's <object>s, in current layout it will capture click events
179
-        // before it reaches the local video object. We hide it here in order
180
-        // to prevent that.
181
-        //if (RTCBrowserType.isIExplorer()) {
182
-            // The issue is not present on Safari. Also if we hide it in Safari
183
-            // then the local audio track will have 'enabled' flag set to false
184
-            // which will result in audio mute issues
185
-            //  $(localAudio).hide();
186
-            localAudio.width = 1;
187
-            localAudio.height = 1;
188
-        //}
189
-    },
190
-
191
     changeLocalVideo (stream) {
173
     changeLocalVideo (stream) {
192
         let localId = APP.conference.getMyUserId();
174
         let localId = APP.conference.getMyUserId();
193
         this.onVideoTypeChanged(localId, stream.videoType);
175
         this.onVideoTypeChanged(localId, stream.videoType);

Loading…
取消
儲存