Browse Source

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.
j8
damencho 9 years ago
parent
commit
bb705e32d9
2 changed files with 8 additions and 8 deletions
  1. 5
    0
      modules/UI/videolayout/LocalVideo.js
  2. 3
    8
      modules/UI/videolayout/VideoLayout.js

+ 5
- 0
modules/UI/videolayout/LocalVideo.js View File

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

+ 3
- 8
modules/UI/videolayout/VideoLayout.js View File

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

Loading…
Cancel
Save