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.
bool isHost = m_pVideoSDK->getSessionInfo()->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.
IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper();
if (pAudioHelper) {
pAudioHelper->unMuteAudio(pRemoteUser);
}
On the target user's device, implement onHostAskUnmute.
void CExampleListener::onHostAskUnmute()
{
// Show a dialog asking the user to unmute, then call:
// IZoomVideoSDKUser* pMyself = m_pVideoSDK->getSessionInfo()->getMyself();
// m_pVideoSDK->getAudioHelper()->unMuteAudio(pMyself);
}
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.
IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper();
// Mute everyone but let them unmute themselves later.
pAudioHelper->muteAllAudio(true);
// Mute everyone and prevent self-unmute.
pAudioHelper->muteAllAudio(false);
To request unmute from every participant (each user still has to accept on their device via onHostAskUnmute), call unMuteAllAudio.
m_pVideoSDK->getAudioHelper()->unMuteAllAudio();
Toggle whether participants can unmute themselves at any time with allowAudioUnmutedBySelf.
IZoomVideoSDKAudioHelper* pAudioHelper = m_pVideoSDK->getAudioHelper();
// Allow self-unmute.
pAudioHelper->allowAudioUnmutedBySelf(true);
// Block self-unmute.
pAudioHelper->allowAudioUnmutedBySelf(false);