ReplaceTrack for ongoing video

How I can change video resolution of publisher without leaving session so subscriber can’t detect it or even knew means very fast .
I’m developing group meeting for larger number of participant can join in one session.

Thanks
Regards
Vipin

@cruizba @pabloFuente @CSantosM
Please guide me.

Using WebRTC features in the browser:

its pure webrtc js how can i use it in openvidu-call
Thanks
Regards
Vipin

Hello @vipin_mishra,

It should work with the replaceTrack function, I do it like this (adapt the code to your needs):

OV.getUserMedia({
   audioSource: false,
   videoSource: undefined,
   resolution: '1280x720', // HERE WILL BE YOUR NEW RESOLUTION
   frameRate: 30 // HERE WILL BE YOUR NEW FRAMERATE
})
.then(mediaStream => {
    var videoTrack = mediaStream.getVideoTracks()[0];
    publisher.replaceTrack(videoTrack).then(function() {
        console.log('New track is being published');
    }).catch(function(error) {
        console.error('Error replacing track');
    });
});

Cheers,
Mihail

Thanks
When I change resolution by changing publisher resolution then subscriber side a black screen shown up for 1sec .
Which is weird.
How solve this one