toggleVideo()

toggleVideo(newState?: boolean)

Toggles user's camera state.

If the camera is currently enabled, then it will be disabled. And vice-versa -> if the camera is currently disabled, then it will be enabled. There is also an optional param to set a concrete target camera state, but you may use disableVideo() and enableVideo() to achieve similar functionality.

//This will toggle the camera state
sambaFrame.toggleVideo();

//This will enable the camera, equivalent to sambaFrame.enableVideo();
sambaFrame.toggleVideo(true); 

//This will disable the camera, equivalent to sambaFrame.disableVideo();
sambaFrame.toggleVideo(false);

Sample use case: Have a custom toolbar in your integration and want user to control camera from it.

Last updated