Sfoglia il codice sorgente

fix(RTC) Use mute/unmute track operation for effects.

Since the track is only temporarily removed and added back, it can be treated like mute & unmute operation. Fixes https://github.com/jitsi/lib-jitsi-meet/issues/2048. Remove a TODO thats no longer needed, track replace operation don't force renegotiations anymore.
dev1
Jaya Allamsetty 2 anni fa
parent
commit
ee0867fd4f
2 ha cambiato i file con 3 aggiunte e 10 eliminazioni
  1. 1
    7
      JitsiConference.js
  2. 2
    3
      modules/RTC/JitsiLocalTrack.js

+ 1
- 7
JitsiConference.js Vedi File

@@ -1312,13 +1312,7 @@ JitsiConference.prototype.replaceTrack = function(oldTrack, newTrack) {
1312 1312
             if ((oldTrackBelongsToConference && oldTrack?.isVideoTrack()) || newTrack?.isVideoTrack()) {
1313 1313
                 this._sendBridgeVideoTypeMessage(newTrack);
1314 1314
             }
1315
-
1316
-            // We do not want to send presence update during setEffect switching, which removes and then adds the same
1317
-            // track back to the conference.
1318
-            if (!(oldTrack?._setEffectInProgress || newTrack?._setEffectInProgress)) {
1319
-                this._updateRoomPresence(this.getActiveMediaSession());
1320
-            }
1321
-
1315
+            this._updateRoomPresence(this.getActiveMediaSession());
1322 1316
             if (newTrack !== null && (this.isMutedByFocus || this.isVideoMutedByFocus)) {
1323 1317
                 this._fireMuteChangeEvent(newTrack);
1324 1318
             }

+ 2
- 3
modules/RTC/JitsiLocalTrack.js Vedi File

@@ -863,15 +863,14 @@ export default class JitsiLocalTrack extends JitsiTrack {
863 863
 
864 864
         this._setEffectInProgress = true;
865 865
 
866
-        // TODO: Create new JingleSessionPC method for replacing a stream in JitsiLocalTrack without offer answer.
867
-        return conference.removeTrack(this)
866
+        return conference._removeLocalTrackAsMute(this)
868 867
             .then(() => {
869 868
                 this._switchStreamEffect(effect);
870 869
                 if (this.isVideoTrack()) {
871 870
                     this.containers.forEach(cont => RTCUtils.attachMediaStream(cont, this.stream));
872 871
                 }
873 872
 
874
-                return conference.addTrack(this);
873
+                return conference._addLocalTrackAsUnmute(this);
875 874
             })
876 875
             .then(() => {
877 876
                 this._setEffectInProgress = false;

Loading…
Annulla
Salva