> ## 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.

# Participant Actions

Manage other participants during an active call session. These methods allow you to mute participants, pause their video, and pin/unpin them in the call layout.

## Prerequisites

* An active [call session](/calls/android/join-session)
* Access to the `CallSession` instance
* Appropriate permissions (typically host/moderator privileges)

## Get CallSession Instance

Participant action 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>

***

## Mute Participant

Mute a specific participant's audio. This prevents other participants from hearing them.

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

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

| Parameter       | Type   | Description                                      |
| --------------- | ------ | ------------------------------------------------ |
| `participantId` | String | The unique identifier of the participant to mute |

<Note>
  When a participant is muted, all participants receive the `onParticipantAudioMuted(Participant)` callback on their `ParticipantEventListener`.
</Note>

***

## Pause Participant Video

Pause a specific participant's video feed. Other participants will see a placeholder instead of their video.

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

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

| Parameter       | Type   | Description                                                   |
| --------------- | ------ | ------------------------------------------------------------- |
| `participantId` | String | The unique identifier of the participant whose video to pause |

<Note>
  When a participant's video is paused, all participants receive the `onParticipantVideoPaused(Participant)` callback on their `ParticipantEventListener`.
</Note>

***

## Pin Participant

Pin a participant to keep them prominently displayed in the call layout, regardless of who is speaking.

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

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

<Note>
  Pinning is particularly useful in Spotlight layout mode where you want to keep a specific participant in focus.
</Note>

***

## Unpin Participant

Remove the pin from a participant, returning to the default layout behavior.

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

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

***

## Listen for Participant Events

Register a `ParticipantEventListener` to receive callbacks when participant states change:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    callSession.addParticipantEventListener(this, object : ParticipantEventListener {
        override fun onParticipantJoined(participant: Participant) {
            Log.d(TAG, "${participant.name} joined the call")
        }

        override fun onParticipantLeft(participant: Participant) {
            Log.d(TAG, "${participant.name} left the call")
        }

        override fun onParticipantAudioMuted(participant: Participant) {
            Log.d(TAG, "${participant.name} was muted")
        }

        override fun onParticipantAudioUnmuted(participant: Participant) {
            Log.d(TAG, "${participant.name} was unmuted")
        }

        override fun onParticipantVideoPaused(participant: Participant) {
            Log.d(TAG, "${participant.name}'s video was paused")
        }

        override fun onParticipantVideoResumed(participant: Participant) {
            Log.d(TAG, "${participant.name}'s video was resumed")
        }

        override fun onParticipantListChanged(participants: List<Participant>) {
            Log.d(TAG, "Participant list updated: ${participants.size} participants")
            // Update your participant list UI
        }

        override fun onDominantSpeakerChanged(participant: Participant) {
            Log.d(TAG, "Dominant speaker: ${participant.name}")
        }

        // Other callbacks...
        override fun onParticipantHandRaised(participant: Participant) {}
        override fun onParticipantHandLowered(participant: Participant) {}
        override fun onParticipantStartedScreenShare(participant: Participant) {}
        override fun onParticipantStoppedScreenShare(participant: Participant) {}
        override fun onParticipantStartedRecording(participant: Participant) {}
        override fun onParticipantStoppedRecording(participant: Participant) {}
    })
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    callSession.addParticipantEventListener(this, new ParticipantEventListener() {
        @Override
        public void onParticipantJoined(Participant participant) {
            Log.d(TAG, participant.getName() + " joined the call");
        }

        @Override
        public void onParticipantLeft(Participant participant) {
            Log.d(TAG, participant.getName() + " left the call");
        }

        @Override
        public void onParticipantAudioMuted(Participant participant) {
            Log.d(TAG, participant.getName() + " was muted");
        }

        @Override
        public void onParticipantAudioUnmuted(Participant participant) {
            Log.d(TAG, participant.getName() + " was unmuted");
        }

        @Override
        public void onParticipantVideoPaused(Participant participant) {
            Log.d(TAG, participant.getName() + "'s video was paused");
        }

        @Override
        public void onParticipantVideoResumed(Participant participant) {
            Log.d(TAG, participant.getName() + "'s video was resumed");
        }

        @Override
        public void onParticipantListChanged(List<Participant> participants) {
            Log.d(TAG, "Participant list updated: " + participants.size() + " participants");
            // Update your participant list UI
        }

        @Override
        public void onDominantSpeakerChanged(Participant participant) {
            Log.d(TAG, "Dominant speaker: " + participant.getName());
        }

        // Other callbacks...
        @Override
        public void onParticipantHandRaised(Participant participant) {}
        @Override
        public void onParticipantHandLowered(Participant participant) {}
        @Override
        public void onParticipantStartedScreenShare(Participant participant) {}
        @Override
        public void onParticipantStoppedScreenShare(Participant participant) {}
        @Override
        public void onParticipantStartedRecording(Participant participant) {}
        @Override
        public void onParticipantStoppedRecording(Participant participant) {}
    });
    ```
  </Tab>
</Tabs>

***

## Participant Object

The `Participant` object contains information about a call participant:

| Property        | Type    | Description                               |
| --------------- | ------- | ----------------------------------------- |
| `uid`           | String  | Unique identifier of the participant      |
| `name`          | String  | Display name of the participant           |
| `avatar`        | String  | URL of the participant's avatar image     |
| `isAudioMuted`  | Boolean | Whether the participant's audio is muted  |
| `isVideoPaused` | Boolean | Whether the participant's video is paused |

***

## Show/Hide Participant List Button

Control the visibility of the participant list button in the call UI:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    val sessionSettings = CometChatCalls.SessionSettingsBuilder()
        .hideParticipantListButton(false)  // Show the participant list button
        .build()
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    SessionSettings sessionSettings = new CometChatCalls.SessionSettingsBuilder()
        .hideParticipantListButton(false)  // Show the participant list button
        .build();
    ```
  </Tab>
</Tabs>

***

## Participant List Button Click Listener

Listen for when users tap the participant list button:

<Tabs>
  <Tab title="Kotlin">
    ```kotlin theme={null}
    callSession.addButtonClickListener(this, object : ButtonClickListener {
        override fun onParticipantListButtonClicked() {
            Log.d(TAG, "Participant list button clicked")
            // Show custom participant list UI if needed
        }

        // Other ButtonClickListener callbacks...
        override fun onLeaveSessionButtonClicked() {}
        override fun onRaiseHandButtonClicked() {}
        override fun onShareInviteButtonClicked() {}
        override fun onChangeLayoutButtonClicked() {}
        override fun onToggleAudioButtonClicked() {}
        override fun onToggleVideoButtonClicked() {}
        override fun onSwitchCameraButtonClicked() {}
        override fun onChatButtonClicked() {}
        override fun onRecordingToggleButtonClicked() {}
    })
    ```
  </Tab>

  <Tab title="Java">
    ```java theme={null}
    callSession.addButtonClickListener(this, new ButtonClickListener() {
        @Override
        public void onParticipantListButtonClicked() {
            Log.d(TAG, "Participant list button clicked");
            // Show custom participant list UI if needed
        }

        // Other ButtonClickListener callbacks...
        @Override
        public void onLeaveSessionButtonClicked() {}
        @Override
        public void onRaiseHandButtonClicked() {}
        @Override
        public void onShareInviteButtonClicked() {}
        @Override
        public void onChangeLayoutButtonClicked() {}
        @Override
        public void onToggleAudioButtonClicked() {}
        @Override
        public void onToggleVideoButtonClicked() {}
        @Override
        public void onSwitchCameraButtonClicked() {}
        @Override
        public void onChatButtonClicked() {}
        @Override
        public void onRecordingToggleButtonClicked() {}
    });
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="Layout & UI" icon="table-cells" href="/calls/android/layout-ui">
    Control call layout and UI elements
  </Card>

  <Card title="Participant Event Listener" icon="bell" href="/calls/android/participant-event-listener">
    Handle all participant events
  </Card>
</CardGroup>
