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,21 +1747,17 @@ export class MatrixCall extends EventEmitter {
|
||||
logger.debug(`stopAllMedia (stream=${this.localUsermediaStream})`);
|
||||
|
||||
for (const feed of this.feeds) {
|
||||
if (feed.isLocal()) {
|
||||
if (feed.purpose === SDPStreamMetadataPurpose.Usermedia) {
|
||||
if (feed.isLocal() && feed.purpose === SDPStreamMetadataPurpose.Usermedia) {
|
||||
this.client.getMediaHandler().stopUserMediaStream(feed.stream);
|
||||
continue;
|
||||
} else if (feed.purpose === SDPStreamMetadataPurpose.Screenshare) {
|
||||
} else if (feed.isLocal() && feed.purpose === SDPStreamMetadataPurpose.Screenshare) {
|
||||
this.client.getMediaHandler().stopScreensharingStream(feed.stream);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
for (const track of feed.stream.getTracks()) {
|
||||
track.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private checkForErrorListener(): void {
|
||||
if (this.listeners("error").length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user