# toggleVideo()

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()](https://docs.digitalsamba.com/reference/sdk/methods/disablevideo) and [enableVideo()](https://docs.digitalsamba.com/reference/sdk/methods/enablevideo) to achieve similar functionality.

```javascript
//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.
