openvidu-browser: speechEvent.stop undefined fix

pull/375/head
pabloFuente 2019-07-04 16:34:11 +02:00
parent edf5bf5fe9
commit 49360d9771
1 changed files with 2 additions and 2 deletions

View File

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