浏览代码

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 年前
父节点
当前提交
ee0867fd4f
共有 2 个文件被更改,包括 3 次插入10 次删除
  1. 1
    7
      JitsiConference.js
  2. 2
    3
      modules/RTC/JitsiLocalTrack.js

+ 1
- 7
JitsiConference.js 查看文件

1312
             if ((oldTrackBelongsToConference && oldTrack?.isVideoTrack()) || newTrack?.isVideoTrack()) {
1312
             if ((oldTrackBelongsToConference && oldTrack?.isVideoTrack()) || newTrack?.isVideoTrack()) {
1313
                 this._sendBridgeVideoTypeMessage(newTrack);
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
             if (newTrack !== null && (this.isMutedByFocus || this.isVideoMutedByFocus)) {
1316
             if (newTrack !== null && (this.isMutedByFocus || this.isVideoMutedByFocus)) {
1323
                 this._fireMuteChangeEvent(newTrack);
1317
                 this._fireMuteChangeEvent(newTrack);
1324
             }
1318
             }

+ 2
- 3
modules/RTC/JitsiLocalTrack.js 查看文件

863
 
863
 
864
         this._setEffectInProgress = true;
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
             .then(() => {
867
             .then(() => {
869
                 this._switchStreamEffect(effect);
868
                 this._switchStreamEffect(effect);
870
                 if (this.isVideoTrack()) {
869
                 if (this.isVideoTrack()) {
871
                     this.containers.forEach(cont => RTCUtils.attachMediaStream(cont, this.stream));
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
             .then(() => {
875
             .then(() => {
877
                 this._setEffectInProgress = false;
876
                 this._setEffectInProgress = false;

正在加载...
取消
保存