瀏覽代碼

fix(RTC): Remove stream effect before disposing the track.

Remove the effect instead of stopping it so that the original stream is restored on both the local track and on the peerconnection. Fixes issues when a stream with effect applied is replaced on the pc after it is muted, also fixes https://github.com/jitsi/lib-jitsi-meet/issues/1537.
dev1
Jaya Allamsetty 4 年之前
父節點
當前提交
e2333c6c2a
共有 1 個檔案被更改,包括 8 行新增4 行删除
  1. 8
    4
      modules/RTC/JitsiLocalTrack.js

+ 8
- 4
modules/RTC/JitsiLocalTrack.js 查看文件

@@ -352,7 +352,7 @@ export default class JitsiLocalTrack extends JitsiTrack {
352 352
             this._streamEffect.stopEffect();
353 353
             this._setStream(this._originalStream);
354 354
             this._originalStream = null;
355
-            this.track = this.stream.getTracks()[0];
355
+            this.track = this.stream ? this.stream.getTracks()[0] : null;
356 356
         }
357 357
     }
358 358
 
@@ -684,12 +684,16 @@ export default class JitsiLocalTrack extends JitsiTrack {
684 684
      * @returns {Promise}
685 685
      */
686 686
     dispose() {
687
-        this._switchStreamEffect();
688
-
689 687
         let promise = Promise.resolve();
690 688
 
689
+        // Remove the effect instead of stopping it so that the original stream is restored
690
+        // on both the local track and on the peerconnection.
691
+        if (this._streamEffect) {
692
+            promise = this.setEffect();
693
+        }
694
+
691 695
         if (this.conference) {
692
-            promise = this.conference.removeTrack(this);
696
+            promise = promise.then(() => this.conference.removeTrack(this));
693 697
         }
694 698
 
695 699
         if (this.stream) {

Loading…
取消
儲存