I am trying to implement a simple system to show the active speaker using the Web Video SDK. According to the docs (Video SDK - web - Core features):
The video-active-change event fires for active speakers who have their video on or off, so you can render the person who is speaking in a larger speaker view layout, whether rendering a video or displaying a video off icon.
But when I tried it in my application, it only triggered when I toggled the video on and off, and it only seemed to be connected to the video state, and not the active speaker. Here is the code:
If I cannot use the video-active-change, what should I use to display the active speaker, as the active-speaker also seems to trigger inconsistently? Sometimes it triggers multiple times when speaking, while other times it triggers once when you start speaking and then never again.
The event only fires when a participant toggles their camera on or off. For example, when another participant turned their camera on and then off, I received:
Even when I speak for longer periods it does not trigger the event. In my tests there are two participants.
I am using "@zoom/videosdk": "^2.2.5", and initializing the client with await newClient.init('en-US', 'Global', { patchJsMedia: true, leaveOnPageUnload: true }).
Is there some specific configuration or setting required to enable the audio-based active speaker detection for video-active-change? Or am I using an incompatible version or is there something else.
Is there some specific configuration or setting required to enable the audio-based active speaker detection for video-active-change?
The video-active-change event excludes the current user, so in a two-person session, when this event is triggered, the userId in the payload will always be the other user.
If you need to include the current user, you can listen to the active-speaker event and take the first user in the payload; this event will include the current user.