twilio-video-app-react icon indicating copy to clipboard operation
twilio-video-app-react copied to clipboard

Grid Mode Participant Camera Seems to be turned off after a while

Open Zeusakos opened this issue 2 years ago • 3 comments

Hello, i ve been using you application in production and i ve also implemented some of the extra features you have implemented like the grid mode. When the participants are above a certain number, the participants camera's seem to close when in reality they are open. I 've had some trouble with this and cannot find the cause, i ve changed clientTrackSwitchOffControl: manual' but it seems the problem keep persisting.

Thank you for your time (Sorry for my english)

Zeusakos avatar Apr 20 '22 06:04 Zeusakos

Hi @Zeusakos - thanks for the question!

It sounds like tracks are still getting switched off even though you have set clientTrackSwitchOffControl to manual, and to me this sounds like expected behavior.

The clientTrackSwitchOffControl setting controls a relatively new feature that was added to the twilio-video SDK. When clientTrackSwitchOffControl is set to auto (which is the default setting in this app), the SDK will automatically detect when a track is not visible (either because the track's video element has left the viewport, or because the user has switched browser tabs), and it will switch off the track to save bandwidth. It's a great feature that can really optimize the performance of a video app, and we recommend that this setting be set to auto.

Developers can change this setting to manual so that their application can control whether or not a track is switched off (with remoteTrack.switchOff() or remoteTrack.switchOn()). This is usually only done when the SDK cannot detect the visibility of a track, which is not a very common occurrence.

It's important to note here, that setting clientTrackSwitchOffControl to manual still does not give a developer total control over when tracks are switched on or off. The SDK may still chose to switch off tracks in cases where a user's available bandwidth may be low. In these cases, the SDK will switch off lower priority tracks, so that the higher priority tracks can still be seen. I suspect that this is what is happening in your app.

The SDK does offer some settings that will change when tracks are switched off due to network congestion. Please see this section of our documentation for more information about these settings: https://www.twilio.com/docs/video/tutorials/using-bandwidth-profile-api#understanding-trackSwitchOffMode

I'd recommend that clientTrackSwitchOffControl be set to auto. With this setting, all off-screen tracks will be switched off, and this will free up bandwidth so that the SDK can display the tracks that are on-screen. With clientTrackSwitchOffControl set to manual, the SDK will try to display all video tracks (even the ones off screen), and this will likely cause some of the on-screen tracks to be switched off due to insufficient bandwidth.

Please let me know how this works out for you! I can further assist if you can provide more information about the settings that you are using, in addition to the changes that you have made to the app. The more technical information that you can provide us, the better. Thanks!

timmydoza avatar May 20 '22 21:05 timmydoza

The problem that occured to me is when i had a meeting in grid mode with 35 people after about half an hour, the 32 participants where turned off. Except the most active one,ourselfs and another one. And this happend to almost everyone in the call. That's why i asked if a can switch it off. It seemed too aggresive at the participants.

Zeusakos avatar May 31 '22 12:05 Zeusakos

Hey @Zeusakos!

If you're looking for less agressive track switch-offs, I think it can be worth it to try trackSwitchOffMode: detected. This is what our docs have to say about the detected mode:

When detected is used, track switch-offs will only happen after congestion actually happens. Thanks to this, detected will avoid any unnecessary switch-offs. However, as congestion is detected through packet loss, a downlink bandwidth drop when using this mode will typically cause choppy audio and frozen video during a few seconds. We only recommend to use detected if video continuity is very important for your use-case.

So it will eliminate unnecessary switch-offs, at the risk of introducing choppy audio. Could be worth a try! Let me know how it works for you.

timmydoza avatar Aug 19 '22 22:08 timmydoza