> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Participant Management

> Manage CometChat Calls SDK v5 participants on iOS with mute, pause video, pinning, permissions, and participant events.

Manage participants during a call with actions like muting, pausing video, and pinning. These features help maintain order in group calls and highlight important speakers.

> [!NOTE]
>
> By default, all participants who join a call have moderator access and can perform these actions. Implementing role-based moderation (e.g., restricting actions to hosts only) is the responsibility of the app developer based on their use case.

## Mute a Participant

Mute a specific participant's audio. This affects the participant for all users in the call.

```swift theme={null}
guard let uid = participant.uid else { return }
CallSession.shared.muteParticipant(participantId: uid)
```

## Pause Participant Video

Pause a specific participant's video. This affects the participant for all users in the call.

```swift theme={null}
guard let uid = participant.uid else { return }
CallSession.shared.pauseParticipantVideo(participantId: uid)
```

## Pin a Participant

Pin a participant to keep them prominently displayed regardless of who is speaking. Useful for keeping focus on a presenter or important speaker.

```swift theme={null}
// Pin a participant
CallSession.shared.pinParticipant(participantId: "PARTICIPANT_UID", type: "pin")

// Unpin (returns to automatic speaker highlighting)
CallSession.shared.unpinParticipant()
```

> [!NOTE]
>
> Pinning a participant only affects your local view. Other participants can pin different users independently.

## Listen for Participant Events

Monitor participant state changes using `ParticipantEventListener`:

```swift theme={null}
class CallViewController: UIViewController, ParticipantEventListener {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        CallSession.shared.addParticipantEventListener(self)
    }
    
    deinit {
        CallSession.shared.removeParticipantEventListener(self)
    }
    
    func onParticipantJoined(participant: Participant) {
        print("\(participant.name ?? "") joined the call")
        updateParticipantList()
    }

    func onParticipantLeft(participant: Participant) {
        print("\(participant.name ?? "") left the call")
        updateParticipantList()
    }

    func onParticipantListChanged(participants: [Participant]) {
        print("Participant count: \(participants.count)")
        refreshParticipantList(participants)
    }

    func onParticipantAudioMuted(participant: Participant) {
        print("\(participant.name ?? "") was muted")
        updateMuteIndicator(participant, muted: true)
    }

    func onParticipantAudioUnmuted(participant: Participant) {
        print("\(participant.name ?? "") was unmuted")
        updateMuteIndicator(participant, muted: false)
    }

    func onParticipantVideoPaused(participant: Participant) {
        print("\(participant.name ?? "") video paused")
        showParticipantAvatar(participant)
    }

    func onParticipantVideoResumed(participant: Participant) {
        print("\(participant.name ?? "") video resumed")
        showParticipantVideo(participant)
    }

    func onDominantSpeakerChanged(participant: Participant) {
        print("\(participant.name ?? "") is now speaking")
        highlightActiveSpeaker(participant)
    }

    // Other callbacks...
    func onParticipantHandRaised(participant: Participant) {}
    func onParticipantHandLowered(participant: Participant) {}
    func onParticipantStartedScreenShare(participant: Participant) {}
    func onParticipantStoppedScreenShare(participant: Participant) {}
    func onParticipantStartedRecording(participant: Participant) {}
    func onParticipantStoppedRecording(participant: Participant) {}
}
```

## Participant Object

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

| Property | Type | Description |
| - | - | - |
| `uid` | `String?` | CometChat user ID — the identifier every moderator action takes |
| `name` | `String?` | Display name |
| `avatar` | `String?` | URL of avatar image |
| `mid` | `String?` | Media ID for this call session |
| `state` | `String?` | Participant state as reported by the server |
| `isJoined` | `Bool?` | Whether the participant is currently joined |
| `joinedAt` | `Int?` | Join timestamp |
| `leftAt` | `Int?` | Leave timestamp |
| `deviceID` | `String?` | Device identifier |
| `totalAudioMinutes` | `Double?` | Audio minutes consumed |
| `totalVideoMinutes` | `Double?` | Video minutes consumed |
| `totalDurationInMinutes` | `Double?` | Total session minutes |

> [!NOTE]
>
> **Every property is Optional.** `Participant` carries no mute / video / pin / hand-raise /
> screen-share flags, and the SDK exposes no getter for them — track that state in your own app
> from the [participant events](https://www.cometchat.com/docs/calls/ios/events.md). Because the events fire only on change, a
> client that joins late cannot recover state that was already in effect.

## Hide Participant List Button

To hide the participant list button in the call UI:

```swift theme={null}
let sessionSettings = CometChatCalls.sessionSettingsBuilder
    .hideParticipantListButton(true)
    .build()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.