Browse Source

fix: Send videoType bridge message for mute/unmute on FF. (#1642)

Set the initial video type state to NONE to cover cases when the endpoint joins video muted.
dev1
Jaya Allamsetty 4 years ago
parent
commit
24627e1b95
No account linked to committer's email address
3 changed files with 18 additions and 3 deletions
  1. 10
    2
      JitsiConference.js
  2. 7
    0
      modules/RTC/JitsiTrack.js
  3. 1
    1
      modules/RTC/RTC.js

+ 10
- 2
JitsiConference.js View File

@@ -1044,6 +1044,14 @@ JitsiConference.prototype._fireMuteChangeEvent = function(track) {
1044 1044
         actorParticipant = this.participants[actorId];
1045 1045
     }
1046 1046
 
1047
+    // Send the video type message to the bridge if the track is not removed/added to the pc as part of
1048
+    // the mute/unmute operation. This currently happens only on Firefox.
1049
+    if (track.isVideoTrack() && !browser.doesVideoMuteByStreamRemove()) {
1050
+        const videoType = track.isMuted() ? VideoType.NONE : track.getVideoType();
1051
+
1052
+        this.rtc.setVideoType(videoType);
1053
+    }
1054
+
1047 1055
     this.eventEmitter.emit(JitsiConferenceEvents.TRACK_MUTE_CHANGED, track, actorParticipant);
1048 1056
 };
1049 1057
 
@@ -1127,7 +1135,7 @@ JitsiConference.prototype.replaceTrack = function(oldTrack, newTrack) {
1127 1135
             if (newTrack) {
1128 1136
                 // Now handle the addition of the newTrack at the JitsiConference level
1129 1137
                 this._setupNewTrack(newTrack);
1130
-                newTrack.isVideoTrack() && this.rtc.setVideoType(newTrack.videoType);
1138
+                newTrack.isVideoTrack() && this.rtc.setVideoType(newTrack.getVideoType());
1131 1139
             } else {
1132 1140
                 oldTrack && oldTrack.isVideoTrack() && this.rtc.setVideoType(VideoType.NONE);
1133 1141
             }
@@ -1251,7 +1259,7 @@ JitsiConference.prototype._addLocalTrackAsUnmute = function(track) {
1251 1259
     return Promise.allSettled(addAsUnmutePromises)
1252 1260
         .then(() => {
1253 1261
             // Signal the video type to the bridge.
1254
-            track.isVideoTrack() && this.rtc.setVideoType(track.videoType);
1262
+            track.isVideoTrack() && this.rtc.setVideoType(track.getVideoType());
1255 1263
         });
1256 1264
 };
1257 1265
 

+ 7
- 0
modules/RTC/JitsiTrack.js View File

@@ -174,6 +174,13 @@ export default class JitsiTrack extends EventEmitter {
174 174
         }
175 175
     }
176 176
 
177
+    /**
178
+     * Returns the video type (camera or desktop) of this track.
179
+     */
180
+    getVideoType() {
181
+        return this.videoType;
182
+    }
183
+
177 184
     /**
178 185
      * Returns the type (audio or video) of this track.
179 186
      */

+ 1
- 1
modules/RTC/RTC.js View File

@@ -152,7 +152,7 @@ export default class RTC extends Listenable {
152 152
             = this._updateAudioOutputForAudioTracks.bind(this);
153 153
 
154 154
         // The default video type assumed by the bridge.
155
-        this._videoType = VideoType.CAMERA;
155
+        this._videoType = VideoType.NONE;
156 156
 
157 157
         // Switch audio output device on all remote audio tracks. Local audio
158 158
         // tracks handle this event by themselves.

Loading…
Cancel
Save