openvidu-browser speech events only for MediaStreams with audio tracks

pull/20/head
pabloFuente 2017-09-30 14:14:10 +02:00
parent 3d98bc93e6
commit fb094f82b7
1 changed files with 18 additions and 14 deletions

View File

@ -54,7 +54,7 @@ export class Stream {
public connection: Connection; public connection: Connection;
private ee = new EventEmitter(); private ee = new EventEmitter();
private wrStream: any; private wrStream: MediaStream;
private wp: any; private wp: any;
private id: string; private id: string;
private video: HTMLVideoElement; private video: HTMLVideoElement;
@ -577,6 +577,8 @@ export class Stream {
this.emitSrcEvent(this.wrStream); this.emitSrcEvent(this.wrStream);
if (this.wrStream.getAudioTracks()[0] != null) {
this.speechEvent = kurentoUtils.WebRtcPeer.hark(this.wrStream, { threshold: this.room.thresholdSpeaker }); this.speechEvent = kurentoUtils.WebRtcPeer.hark(this.wrStream, { threshold: this.room.thresholdSpeaker });
this.speechEvent.on('speaking', () => { this.speechEvent.on('speaking', () => {
@ -592,6 +594,8 @@ export class Stream {
participantId: participantId participantId: participantId
}]); }]);
}); });
}
} }
for (let videoElement of this.videoElements) { for (let videoElement of this.videoElements) {
let thumbnailId = videoElement.thumb; let thumbnailId = videoElement.thumb;