1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-01 04:43:29 +03:00

Clean up stopAllMedia

This commit is contained in:
Robert Long
2021-09-15 12:38:12 -07:00
parent c4d7fef0cd
commit f3a2bd6b40

View File

@@ -1747,19 +1747,15 @@ export class MatrixCall extends EventEmitter {
logger.debug(`stopAllMedia (stream=${this.localUsermediaStream})`); logger.debug(`stopAllMedia (stream=${this.localUsermediaStream})`);
for (const feed of this.feeds) { for (const feed of this.feeds) {
if (feed.isLocal()) { if (feed.isLocal() && feed.purpose === SDPStreamMetadataPurpose.Usermedia) {
if (feed.purpose === SDPStreamMetadataPurpose.Usermedia) { this.client.getMediaHandler().stopUserMediaStream(feed.stream);
this.client.getMediaHandler().stopUserMediaStream(feed.stream); } else if (feed.isLocal() && feed.purpose === SDPStreamMetadataPurpose.Screenshare) {
continue; this.client.getMediaHandler().stopScreensharingStream(feed.stream);
} else if (feed.purpose === SDPStreamMetadataPurpose.Screenshare) { } else {
this.client.getMediaHandler().stopScreensharingStream(feed.stream); for (const track of feed.stream.getTracks()) {
continue; track.stop();
} }
} }
for (const track of feed.stream.getTracks()) {
track.stop();
}
} }
} }