From fa08ee87f09d149626e5305cbd59bb017d715287 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Thu, 4 Jul 2019 16:36:22 +0200 Subject: [PATCH] openvidu-browser: speechEvent.stop fix 2 --- openvidu-browser/src/OpenVidu/Stream.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openvidu-browser/src/OpenVidu/Stream.ts b/openvidu-browser/src/OpenVidu/Stream.ts index 506347cd..730e5ec8 100644 --- a/openvidu-browser/src/OpenVidu/Stream.ts +++ b/openvidu-browser/src/OpenVidu/Stream.ts @@ -457,8 +457,10 @@ export class Stream implements EventDispatcher { typeof MediaStreamTrack !== 'undefined' && this.outboundStreamOpts.publisherProperties.videoSource instanceof MediaStreamTrack; this.webRtcPeer.dispose(isSenderAndCustomTrack); } - if (!!this.speechEvent && !!this.speechEvent.stop) { - this.speechEvent.stop(); + if (!!this.speechEvent) { + if (!!this.speechEvent.stop) { + this.speechEvent.stop(); + } delete this.speechEvent; }