1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Stop streams if the call has ended

When we get user media, don't forget to close the streams if the
call's ended by the time we got media.
This commit is contained in:
David Baker
2021-03-08 16:55:48 +00:00
parent a034ca171e
commit 1ac5c9acbd

View File

@@ -825,8 +825,11 @@ export class MatrixCall extends EventEmitter {
return;
}
if (this.callHasEnded()) {
this.stopAllMedia();
return;
}
this.localAVStream = stream;
logger.info("Got local AV stream with id " + this.localAVStream.id);
this.setState(CallState.CreateOffer);
@@ -852,8 +855,6 @@ export class MatrixCall extends EventEmitter {
}
}
this.localAVStream = stream;
logger.info("Got local AV stream with id " + this.localAVStream.id);
// why do we enable audio (and only audio) tracks here? -- matthew
setTracksEnabled(stream.getAudioTracks(), true);
this.peerConn = this.createPeerConnection();