Pārlūkot izejas kodu

Fixes SmallVideo object not making a difference between an audio and a video stream, which was causing FireFox issues with large video set to the audio stream.

master
yanas 9 gadus atpakaļ
vecāks
revīzija
fe2804f474

+ 1
- 1
modules/UI/videolayout/LocalVideo.js Parādīt failu

@@ -148,7 +148,7 @@ LocalVideo.prototype.createConnectionIndicator = function() {
148 148
 };
149 149
 
150 150
 LocalVideo.prototype.changeVideo = function (stream) {
151
-    this.stream = stream;
151
+    this.videoStream = stream;
152 152
 
153 153
     let localVideoClick = (event) => {
154 154
         // FIXME: with Temasys plugin event arg is not an event, but

+ 3
- 4
modules/UI/videolayout/RemoteVideo.js Parādīt failu

@@ -143,7 +143,7 @@ if (!interfaceConfig.filmStripOnly) {
143 143
  * Removes the remote stream element corresponding to the given stream and
144 144
  * parent container.
145 145
  *
146
- * @param stream the stream
146
+ * @param stream the MediaStream
147 147
  * @param isVideo <tt>true</tt> if given <tt>stream</tt> is a video one.
148 148
  */
149 149
 RemoteVideo.prototype.removeRemoteStreamElement =
@@ -219,9 +219,8 @@ RemoteVideo.prototype.addRemoteStreamElement = function (stream) {
219 219
         return;
220 220
     }
221 221
 
222
-    this.stream = stream;
223
-
224 222
     let isVideo = stream.isVideoTrack();
223
+    isVideo ? this.videoStream = stream : this.audioStream = stream;
225 224
 
226 225
     // Add click handler.
227 226
     let onClickHandler = (event) => {
@@ -250,7 +249,7 @@ RemoteVideo.prototype.addRemoteStreamElement = function (stream) {
250 249
 
251 250
     let sel = $(`#${newElementId}`);
252 251
 
253
-    // If the container is currently visible we attach the stream.
252
+    // If the container is currently visible we attach the stream to the element.
254 253
     if (!isVideo || (this.container.offsetParent !== null && isVideo)) {
255 254
         this.waitForPlayback(sel, stream);
256 255
 

+ 5
- 4
modules/UI/videolayout/SmallVideo.js Parādīt failu

@@ -9,7 +9,8 @@ function SmallVideo() {
9 9
     this.isMuted = false;
10 10
     this.hasAvatar = false;
11 11
     this.isVideoMuted = false;
12
-    this.stream = null;
12
+    this.videoStream = null;
13
+    this.audioStream = null;
13 14
 }
14 15
 
15 16
 function setVisibility(selector, show) {
@@ -18,8 +19,8 @@ function setVisibility(selector, show) {
18 19
     }
19 20
 }
20 21
 
21
-/**
22
- * Indicates if this small video is currently visible.
22
+
23
+/* Indicates if this small video is currently visible.
23 24
  *
24 25
  * @return <tt>true</tt> if this small video isn't currently visible and
25 26
  * <tt>false</tt> - otherwise.
@@ -370,7 +371,7 @@ SmallVideo.prototype.updateView = function () {
370 371
     } else {
371 372
         // We want to show the avatar when the video is muted or not exists
372 373
         // that is when 'true' or 'null' is returned
373
-        showAvatar = !this.stream || this.stream.isMuted();
374
+        showAvatar = !this.videoStream || this.videoStream.isMuted();
374 375
     }
375 376
 
376 377
     showAvatar = showAvatar && !isCurrentlyOnLarge;

+ 4
- 4
modules/UI/videolayout/VideoLayout.js Parādīt failu

@@ -49,7 +49,7 @@ function onContactClicked (id) {
49 49
     if (remoteVideo && remoteVideo.selectVideoElement().length) {
50 50
         // It is not always the case that a videoThumb exists (if there is
51 51
         // no actual video).
52
-        if (remoteVideo.stream) {
52
+        if (remoteVideo.videoStream) {
53 53
 
54 54
             // We have a video src, great! Let's update the large video
55 55
             // now.
@@ -694,7 +694,7 @@ var VideoLayout = {
694 694
                 if (!remoteVideo.isVisible()) {
695 695
                     console.log("Add to last N", resourceJid);
696 696
 
697
-                    remoteVideo.addRemoteStreamElement(remoteVideo.stream);
697
+                    remoteVideo.addRemoteStreamElement(remoteVideo.videoStream);
698 698
 
699 699
                     if (lastNPickupId == resourceJid) {
700 700
                         // Clean up the lastN pickup id.
@@ -709,7 +709,7 @@ var VideoLayout = {
709 709
                         updateLargeVideo = false;
710 710
                     }
711 711
                     remoteVideo.waitForPlayback(
712
-                        remoteVideo.selectVideoElement(), remoteVideo.stream);
712
+                        remoteVideo.selectVideoElement(), remoteVideo.videoStream);
713 713
                 }
714 714
             });
715 715
         }
@@ -987,7 +987,7 @@ var VideoLayout = {
987 987
 
988 988
             let videoType = this.getRemoteVideoType(id);
989 989
             largeVideo.updateLargeVideo(
990
-                smallVideo.stream,
990
+                smallVideo.videoStream,
991 991
                 videoType
992 992
             ).then(function() {
993 993
                 // update current small video and the old one

Notiek ielāde…
Atcelt
Saglabāt