mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: Fixed bug with audio only MediaStream
If a MediaStream is published with video track stopped and a standard audio track, the video was not playing because the video track of subscriber was enabled. This track must be disabled for allowing play the video. Issue reference: https://openvidu.discourse.group/t/microphone-doesnt-work-correctly-on-web-from-a-mobile-device/4514pull/797/head
parent
dade445ce7
commit
ec807d3944
|
@ -992,6 +992,10 @@ export class Session extends EventDispatcher {
|
|||
oldValue = stream.videoActive;
|
||||
event.newValue = event.newValue === 'true';
|
||||
stream.videoActive = event.newValue;
|
||||
const videoTrack = stream.getMediaStream().getVideoTracks()[0];
|
||||
if(!videoTrack.enabled && stream.videoActive){
|
||||
videoTrack.enabled = true;
|
||||
}
|
||||
break;
|
||||
case 'videoTrack':
|
||||
event.newValue = JSON.parse(event.newValue);
|
||||
|
|
|
@ -1481,7 +1481,7 @@ export class Stream {
|
|||
this.mediaStream.getAudioTracks()[0].enabled = enabled;
|
||||
}
|
||||
if (!!this.mediaStream.getVideoTracks()[0]) {
|
||||
const enabled = reconnect ? this.videoActive : !!(this.streamManager as Subscriber).properties.subscribeToVideo;
|
||||
const enabled = reconnect ? this.videoActive : !!this.videoActive && !!(this.streamManager as Subscriber).properties.subscribeToVideo;
|
||||
this.mediaStream.getVideoTracks()[0].enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue