mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Fixed replaced track after mute camera
openvidu-browser needs a mediaStreamTrack param if a custom was assigned before mute video track releasing resources.pull/750/head
parent
7296057184
commit
27e686271e
|
@ -287,7 +287,15 @@ export class OpenViduService {
|
|||
*/
|
||||
private async publishVideoAux(publisher: Publisher, publish: boolean): Promise<void> {
|
||||
if (!!publisher) {
|
||||
await publisher.publishVideo(publish, true);
|
||||
let resource: boolean | MediaStreamTrack = true;
|
||||
if(publish){
|
||||
// Forcing restoration with a custom media stream (the older one instead the default)
|
||||
const currentDeviceId = this.deviceService.getCameraSelected()?.device;
|
||||
const mediaStream = await this.createMediaStream({videoSource: currentDeviceId, audioSource: false});
|
||||
resource = mediaStream.getVideoTracks()[0];
|
||||
}
|
||||
|
||||
await publisher.publishVideo(publish, resource);
|
||||
this.participantService.updateLocalParticipant();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue