You've already forked matrix-js-sdk
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:
@@ -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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user