Host audio controls

The controls in this topic have an effect only when the local user is the session host. Check isHost before exposing host controls in your UI. For the basic controls available to every user, see Core features.

let isHost = ZoomVideoSDK.shareInstance()?.getSession()?.getMySelf()?.isHost()
BOOL isHost = [[[[ZoomVideoSDK shareInstance] getSession] getMySelf] isHost];

Ask a single user to unmute

When the local user is the host, calling unmuteAudio on a remote user does not unmute them directly. It sends an unmute request. The target user's app receives the onHostAskUnmute callback and is responsible for prompting the user before calling unmuteAudio on themselves.

// Host sends the request.
ZoomVideoSDK.shareInstance()?.getAudioHelper()?.unmuteAudio(remoteUser)
// Host sends the request.
[[[ZoomVideoSDK shareInstance] getAudioHelper] unmuteAudio:remoteUser];

On the target user's device, implement onHostAskUnmute.

func onHostAskUnmute() {
    // Show a dialog asking the user to unmute, then call:
    // if let mySelf = ZoomVideoSDK.shareInstance()?.getSession()?.getMySelf() {
    //     ZoomVideoSDK.shareInstance()?.getAudioHelper()?.unmuteAudio(mySelf)
    // }
}
- (void)onHostAskUnmute {
    // Show a dialog asking the user to unmute, then call:
    // ZoomVideoSDKUser *mySelf = [[[ZoomVideoSDK shareInstance] getSession] getMySelf];
    // [[[ZoomVideoSDK shareInstance] getAudioHelper] unmuteAudio:mySelf];
}

Mute or unmute everyone

The host can mute every participant at once with muteAllAudio. Passing true lets participants unmute themselves afterward; passing false keeps them muted until the host unmutes them or grants self-unmute with allowAudioUnmutedBySelf.

let audioHelper = ZoomVideoSDK.shareInstance()?.getAudioHelper()
// Mute everyone but let them unmute themselves later.
audioHelper?.muteAllAudio(true)
// Mute everyone and prevent self-unmute.
audioHelper?.muteAllAudio(false)
ZoomVideoSDKAudioHelper *audioHelper = [[ZoomVideoSDK shareInstance] getAudioHelper];
// Mute everyone but let them unmute themselves later.
[audioHelper muteAllAudio:YES];
// Mute everyone and prevent self-unmute.
[audioHelper muteAllAudio:NO];

To request unmute from every participant (each user still has to accept on their device via onHostAskUnmute), call unmuteAllAudio.

ZoomVideoSDK.shareInstance()?.getAudioHelper()?.unmuteAllAudio()
[[[ZoomVideoSDK shareInstance] getAudioHelper] unmuteAllAudio];

Toggle whether participants can unmute themselves at any time with allowAudioUnmutedBySelf.

let audioHelper = ZoomVideoSDK.shareInstance()?.getAudioHelper()
// Allow self-unmute.
audioHelper?.allowAudioUnmutedBySelf(true)
// Block self-unmute.
audioHelper?.allowAudioUnmutedBySelf(false)
ZoomVideoSDKAudioHelper *audioHelper = [[ZoomVideoSDK shareInstance] getAudioHelper];
// Allow self-unmute.
[audioHelper allowAudioUnmutedBySelf:YES];
// Block self-unmute.
[audioHelper allowAudioUnmutedBySelf:NO];