> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-v6-beta2-flutter-uikit.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Video Controls

Control video during an active call session. These methods allow you to pause/resume the local camera and switch between front and back cameras.

## Prerequisites

* An active [call session](/calls/android/join-session)
* Access to the `CallSession` instance
* Camera permissions granted

## Get CallSession Instance

All video control methods are called on the `CallSession` singleton:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    val callSession = CallSession.getInstance()
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    CallSession callSession = CallSession.getInstance();
    ```
  </Tab>
</Tabs>

***

## Pause Video

Turn off the local camera. Other participants will see a placeholder instead of your video feed.

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    callSession.pauseVideo()
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    callSession.pauseVideo();
    ```
  </Tab>
</Tabs>

<Note>
  When you pause your video, the `onVideoPaused()` callback is triggered on your `MediaEventsListener`.
</Note>

***

## Resume Video

Turn on the local camera to resume transmitting video.

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    callSession.resumeVideo()
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    callSession.resumeVideo();
    ```
  </Tab>
</Tabs>

<Note>
  When you resume your video, the `onVideoResumed()` callback is triggered on your `MediaEventsListener`.
</Note>

***

## Switch Camera

Toggle between the front-facing and rear cameras.

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    callSession.switchCamera()
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    callSession.switchCamera();
    ```
  </Tab>
</Tabs>

<Note>
  When the camera is switched, the `onCameraFacingChanged(CameraFacing)` callback is triggered on your `MediaEventsListener`.
</Note>

### CameraFacing Enum

| Value   | Description                         |
| ------- | ----------------------------------- |
| `FRONT` | Front-facing camera (selfie camera) |
| `BACK`  | Rear camera                         |

***

## Listen for Video Events

Register a `MediaEventsListener` to receive callbacks when video state changes:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    callSession.addMediaEventsListener(this, object : MediaEventsListener {
        override fun onVideoPaused() {
            Log.d(TAG, "Video paused")
            // Update UI to show video off state
        }

        override fun onVideoResumed() {
            Log.d(TAG, "Video resumed")
            // Update UI to show video on state
        }

        override fun onCameraFacingChanged(cameraFacing: CameraFacing) {
            Log.d(TAG, "Camera switched to: ${cameraFacing.value}")
            // Update UI to reflect camera change
        }

        // Other MediaEventsListener callbacks...
        override fun onRecordingStarted() {}
        override fun onRecordingStopped() {}
        override fun onScreenShareStarted() {}
        override fun onScreenShareStopped() {}
        override fun onAudioModeChanged(audioMode: AudioMode) {}
        override fun onAudioMuted() {}
        override fun onAudioUnMuted() {}
    })
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    callSession.addMediaEventsListener(this, new MediaEventsListener() {
        @Override
        public void onVideoPaused() {
            Log.d(TAG, "Video paused");
            // Update UI to show video off state
        }

        @Override
        public void onVideoResumed() {
            Log.d(TAG, "Video resumed");
            // Update UI to show video on state
        }

        @Override
        public void onCameraFacingChanged(CameraFacing cameraFacing) {
            Log.d(TAG, "Camera switched to: " + cameraFacing.getValue());
            // Update UI to reflect camera change
        }

        // Other MediaEventsListener callbacks...
        @Override
        public void onRecordingStarted() {}
        @Override
        public void onRecordingStopped() {}
        @Override
        public void onScreenShareStarted() {}
        @Override
        public void onScreenShareStopped() {}
        @Override
        public void onAudioModeChanged(AudioMode audioMode) {}
        @Override
        public void onAudioMuted() {}
        @Override
        public void onAudioUnMuted() {}
    });
    ```
  </Tab>
</Tabs>

***

## Initial Video Settings

You can configure the initial video state when joining a session using `SessionSettings`:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    val sessionSettings = CometChatCalls.SessionSettingsBuilder()
        .startVideoPaused(true)                      // Start with camera off
        .setInitialCameraFacing(CameraFacing.FRONT)  // Start with front camera
        .setType(SessionType.VIDEO)                  // Video call (not audio-only)
        .build()
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    SessionSettings sessionSettings = new CometChatCalls.SessionSettingsBuilder()
        .startVideoPaused(true)                      // Start with camera off
        .setInitialCameraFacing(CameraFacing.FRONT)  // Start with front camera
        .setType(SessionType.VIDEO)                  // Video call (not audio-only)
        .build();
    ```
  </Tab>
</Tabs>

***

## Hide Video Controls in UI

You can hide the built-in video control buttons using `SessionSettings`:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    val sessionSettings = CometChatCalls.SessionSettingsBuilder()
        .hideToggleVideoButton(true)   // Hide the video on/off button
        .hideSwitchCameraButton(true)  // Hide the camera flip button
        .build()
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    SessionSettings sessionSettings = new CometChatCalls.SessionSettingsBuilder()
        .hideToggleVideoButton(true)   // Hide the video on/off button
        .hideSwitchCameraButton(true)  // Hide the camera flip button
        .build();
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="Recording" icon="circle-dot" href="/calls/android/recording">
    Record call sessions
  </Card>

  <Card title="Media Events Listener" icon="bell" href="/calls/android/media-events-listener">
    Handle all media events
  </Card>
</CardGroup>
