|
@@ -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) {
|