From 49360d9771652b83c53f9c668460ee71a548440a Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 4 Jul 2019 16:34:11 +0200 Subject: [PATCH] openvidu-browser: speechEvent.stop undefined fix --- openvidu-browser/src/OpenVidu/Stream.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openvidu-browser/src/OpenVidu/Stream.ts b/openvidu-browser/src/OpenVidu/Stream.ts index dd3ee33f..506347cd 100644 --- a/openvidu-browser/src/OpenVidu/Stream.ts +++ b/openvidu-browser/src/OpenVidu/Stream.ts @@ -452,12 +452,12 @@ export class Stream implements EventDispatcher { * @hidden */ disposeWebRtcPeer(): void { - if (this.webRtcPeer) { + if (!!this.webRtcPeer) { const isSenderAndCustomTrack: boolean = !!this.outboundStreamOpts && typeof MediaStreamTrack !== 'undefined' && this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack; this.webRtcPeer.dispose(isSenderAndCustomTrack); } - if (this.speechEvent) { + if (!!this.speechEvent && !!this.speechEvent.stop) { this.speechEvent.stop(); delete this.speechEvent; }