openvidu-browser: speechEvent.stop fix 2

pull/375/head
pabloFuente 2019-07-04 16:36:22 +02:00
parent 49360d9771
commit fa08ee87f0
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}