mirror of https://github.com/OpenVidu/openvidu.git
new fix for #107 ?
parent
6e7d345774
commit
75cb15ee12
|
@ -447,12 +447,17 @@ export class Stream implements EventDispatcher {
|
||||||
*/
|
*/
|
||||||
disposeMediaStream(): void {
|
disposeMediaStream(): void {
|
||||||
if (this.mediaStream) {
|
if (this.mediaStream) {
|
||||||
|
const isSenderAndCustomTrack: boolean = !!this.outboundStreamOpts &&
|
||||||
|
this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack;
|
||||||
|
|
||||||
|
if (!isSenderAndCustomTrack) {
|
||||||
this.mediaStream.getAudioTracks().forEach((track) => {
|
this.mediaStream.getAudioTracks().forEach((track) => {
|
||||||
track.stop();
|
track.stop();
|
||||||
});
|
});
|
||||||
this.mediaStream.getVideoTracks().forEach((track) => {
|
this.mediaStream.getVideoTracks().forEach((track) => {
|
||||||
track.stop();
|
track.stop();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
delete this.mediaStream;
|
delete this.mediaStream;
|
||||||
}
|
}
|
||||||
console.info((!!this.outboundStreamOpts ? 'Local ' : 'Remote ') + "MediaStream from 'Stream' with id [" + this.streamId + '] is now disposed');
|
console.info((!!this.outboundStreamOpts ? 'Local ' : 'Remote ') + "MediaStream from 'Stream' with id [" + this.streamId + '] is now disposed');
|
||||||
|
|
Loading…
Reference in New Issue