> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-ios-v5-calls-corrections.mintlify.site/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.
</Note>

## Mute a Participant

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

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    guard let uid = participant.uid else { return }
    CallSession.shared.muteParticipant(participantId: uid)
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    if (participant.uid) {
        [[CallSession shared] muteParticipantWithParticipantId:participant.uid];
    }
    ```
  </Tab>
</Tabs>

## Pause Participant Video

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

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    guard let uid = participant.uid else { return }
    CallSession.shared.pauseParticipantVideo(participantId: uid)
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    if (participant.uid) {
        [[CallSession shared] pauseParticipantVideoWithParticipantId:participant.uid];
    }
    ```
  </Tab>
</Tabs>

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

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

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

  <Tab title="Objective-C">
    ```objectivec theme={null}
    // Pin a participant
    [[CallSession shared] pinParticipantWithParticipantId:@"PARTICIPANT_UID" type:@"pin"];

    // Unpin (returns to automatic speaker highlighting)
    [[CallSession shared] unpinParticipant];
    ```
  </Tab>
</Tabs>

<Note>
  Pinning a participant only affects your local view. Other participants can pin different users independently.
</Note>

## Listen for Participant Events

Monitor participant state changes using `ParticipantEventListener`:

<Tabs>
  <Tab title="Swift">
    ```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) {}
    }
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    @interface CallViewController () <ParticipantEventListener>
    @end

    @implementation CallViewController

    - (void)viewDidLoad {
        [super viewDidLoad];
        [[CallSession shared] addParticipantEventListener:self];
    }

    - (void)dealloc {
        [[CallSession shared] removeParticipantEventListener:self];
    }

    - (void)onParticipantJoinedWithParticipant:(Participant *)participant {
        NSLog(@"%@ joined the call", participant.name);
        [self updateParticipantList];
    }

    - (void)onParticipantLeftWithParticipant:(Participant *)participant {
        NSLog(@"%@ left the call", participant.name);
        [self updateParticipantList];
    }

    - (void)onParticipantListChangedWithParticipants:(NSArray<Participant *> *)participants {
        NSLog(@"Participant count: %lu", (unsigned long)participants.count);
        [self refreshParticipantList:participants];
    }

    - (void)onParticipantAudioMutedWithParticipant:(Participant *)participant {
        NSLog(@"%@ was muted", participant.name);
    }

    - (void)onParticipantAudioUnmutedWithParticipant:(Participant *)participant {
        NSLog(@"%@ was unmuted", participant.name);
    }

    - (void)onDominantSpeakerChangedWithParticipant:(Participant *)participant {
        NSLog(@"%@ is now speaking", participant.name);
    }

    // Other callbacks...

    @end
    ```
  </Tab>
</Tabs>

## 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](/calls/ios/events). Because the events fire only on change, a
  client that joins late cannot recover state that was already in effect.
</Note>

## Hide Participant List Button

To hide the participant list button in the call UI:

<Tabs>
  <Tab title="Swift">
    ```swift theme={null}
    let sessionSettings = CometChatCalls.sessionSettingsBuilder
        .hideParticipantListButton(true)
        .build()
    ```
  </Tab>

  <Tab title="Objective-C">
    ```objectivec theme={null}
    SessionSettings *sessionSettings = [[[CometChatCalls sessionSettingsBuilder]
        hideParticipantListButton:YES]
        build];
    ```
  </Tab>
</Tabs>
