pull/127/merge
Martin Stcknbrkr 2024-06-14 10:15:01 +00:00 committed by GitHub
commit bd442d205d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 6 deletions

View File

@ -728,12 +728,17 @@ export class Stream {
} }
} }
if (this.mediaStream) { if (this.mediaStream) {
this.mediaStream.getAudioTracks().forEach((track) => { const isSenderAndCustomTrack: boolean = !!this.outboundStreamOpts &&
track.stop(); this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack;
});
this.mediaStream.getVideoTracks().forEach((track) => { if (!isSenderAndCustomTrack) {
track.stop(); this.mediaStream.getAudioTracks().forEach((track) => {
}); track.stop();
});
this.mediaStream.getVideoTracks().forEach((track) => {
track.stop();
});
}
delete this.mediaStream; delete this.mediaStream;
} }
// If subscribeToRemote local MediaStream must be stopped // If subscribeToRemote local MediaStream must be stopped