瀏覽代碼

Moves local video thumb initializations where they belong.

Moves local video thumb initializations where they belong in the local video constructor. Fixes a problem when there is no video device, then audio levels and gsm bars are missing. We were doing this initializations every time a video device is changed.
master
damencho 9 年之前
父節點
當前提交
bb705e32d9
共有 2 個檔案被更改,包括 8 行新增8 行删除
  1. 5
    0
      modules/UI/videolayout/LocalVideo.js
  2. 3
    8
      modules/UI/videolayout/VideoLayout.js

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

24
     this.initBrowserSpecificProperties();
24
     this.initBrowserSpecificProperties();
25
 
25
 
26
     SmallVideo.call(this, VideoLayout);
26
     SmallVideo.call(this, VideoLayout);
27
+
28
+    // Set default display name.
29
+    this.setDisplayName();
30
+
31
+    this.createConnectionIndicator();
27
 }
32
 }
28
 
33
 
29
 LocalVideo.prototype = Object.create(SmallVideo.prototype);
34
 LocalVideo.prototype = Object.create(SmallVideo.prototype);

+ 3
- 8
modules/UI/videolayout/VideoLayout.js 查看文件

107
         localVideoThumbnail.setVideoType(VIDEO_CONTAINER_TYPE);
107
         localVideoThumbnail.setVideoType(VIDEO_CONTAINER_TYPE);
108
         // if we do not resize the thumbs here, if there is no video device
108
         // if we do not resize the thumbs here, if there is no video device
109
         // the local video thumb maybe one pixel
109
         // the local video thumb maybe one pixel
110
-        this.resizeThumbnails(false, true, false);
110
+        let {thumbWidth, thumbHeight}
111
+            = this.resizeThumbnails(false, true, false);
112
+        AudioLevels.updateAudioLevelCanvas(null, thumbWidth, thumbHeight);
111
 
113
 
112
         emitter.addListener(UIEvents.CONTACT_CLICKED, onContactClicked);
114
         emitter.addListener(UIEvents.CONTACT_CLICKED, onContactClicked);
113
         this.lastNCount = config.channelLastN;
115
         this.lastNCount = config.channelLastN;
158
     },
160
     },
159
 
161
 
160
     changeLocalVideo (stream) {
162
     changeLocalVideo (stream) {
161
-        // Set default display name.
162
-        localVideoThumbnail.setDisplayName();
163
-        localVideoThumbnail.createConnectionIndicator();
164
-
165
         let localId = APP.conference.getMyUserId();
163
         let localId = APP.conference.getMyUserId();
166
         this.onVideoTypeChanged(localId, stream.videoType);
164
         this.onVideoTypeChanged(localId, stream.videoType);
167
 
165
 
168
-        let {thumbWidth, thumbHeight} = this.resizeThumbnails(false, true);
169
-        AudioLevels.updateAudioLevelCanvas(null, thumbWidth, thumbHeight);
170
-
171
         if (!stream.isMuted()) {
166
         if (!stream.isMuted()) {
172
             localVideoThumbnail.changeVideo(stream);
167
             localVideoThumbnail.changeVideo(stream);
173
         }
168
         }

Loading…
取消
儲存