Can't update VIDEO styles dynamically

Hi there,
I am trying to dynamically (app is built in React) change styles passed to video component.
I want to change these styles when changing between Video <=> ScreenSharing.

My render method has got the updated values.
And given this value I want to render Video Component with different styles. I even tried to render different instance of Video Component, but still nothing.

Unfortunately, video dom element doesn’t seem to update… Anyone has any experience regarding issues like this?

Internet says that Video tag rerenders only when “src” changes - how do we update this in OpenVidu?

Cheers

This has very little to do with OpenVidu. It’s very weird that the styles doesn’t apply when react render the view.

Ask in react forums or google it. I don’t know how to address weird issue.

Regarding this:

Internet says that Video tag rerenders only when “src” changes

You could try to reassign the src object to the video as a workaround or create a new video element with the new styles and use OpenVidu.addVideoElement method to reassign it.

Or automatically you can create a new publisher using OpenVidu.initPublisher method to switch between camera and screen.