Main Video managed remotely

Hi guys, thanks for you help in advance…

I have implemented OpenVidu in my Reactjs app, everything working great.

Now, I created a layout that looks like Google Meet, 1 big screen for the main presenter and others small for the participantes.
What would like to implement such function that will switch the video to the main screen when the user is talking. Found out about the speech recognition and that is working great. Now, I know how to send the video to the main screen locally (it is on the initial template). But my doubt is, how can I have the main screen video controlled by the server, so when I change the video source for the user that is talking, I could change for all the users that in on the conference ?

Hey @jefersonbrz.costa ,

You can use a custom signal on your client and send a message to others when a user change the video source. OpenVidu Docs

Or you can just use the speech event for all streams, in all clients. Each client will trigger the event for all subscribed streams. No need to interchange messages between clients, as all of them are locally capable of knowing which user is the one talking at every moment.

Thanks for the reply, so, as far I understood, I can :slight_smile: mySession.on(‘publisherStartSpeaking’, (event) => {
// GET THIS PUBLISHER VIDEO SOURCE AND SET IN MY MAIN DIV THAT HAS TEH BIGGER VIDEO
})

?

Of course. Just as explained in the docs: https://docs.openvidu.io/en/latest/advanced-features/speech-detection/

Hey @pabloFuente I am using voice recognition, getting the connection and changing the state getting the video from subscribers and putting in the mainDiv, but the problem it is only working for one user, do you know the reason?

Hi CSantos, how can I be listening to the user in order to send the signal? Do you have any suggestion?

You can send a signal message to opposite user and using this change the layout…
This is also a way but what I suggested you also best way is detect volume in pubilsher