publisher.replaceTrack() setting publishVideo to true automatically?

Hi there, working on a webinar app and everything is going great for the most part. But I’ve hit another small snag today.

I want the user to be able to toggle between screen share and webcam. On top of that I have a video on/off button which just sets publisher.publishVideo(true/false).

That works great until I start switching between webcam/screenshare with publisher.replaceTrack(). It seems like replaceTrack is automatically setting publisher.publishVideo(true)?

Even when I try setting publisher.publishVideo(false) in the promise of replaceTrack(), the video (camera or webcam) gets published.

Anything I am missing here?

See commit openvidu-browser: fix echo when calling Publisher#replaceTrack · OpenVidu/openvidu@17ff910 · GitHub

Hi @pabloFuente, it’s been awhile but if I remember correctly this is related to the “fix” of setting publisher.videoReference.muted = true; ?

Does this mean I should be able to remove this code on my end when I update to the next version of OpenVidu?

Thanks

Yes, this should be handled by openvidu-browser from now on.