Live SDKs iOS v1
Live SDKs iOS
Live SDKs
iOS
Version 1

Manage media during a live event

Copy link

Once one of the hosts starts the live event by calling the startEvent() method, the state changes to ongoing. While the live event is ongoing, the hosts in the event can perform various actions to manage media such as turning on or off their audio and video, and switching the audio and video sources.

// The user must be a host in order to control the media of the live event.
guard liveEvent.myRole == .host else { return }

// Mute audio input.
liveEvent.muteAudioInput { error in
   guard error == nil else { return }
}

// Unmute audio output.
liveEvent.unmuteAudioInput { error in
   guard error == nil else { return }
}

// Start video.
liveEvent.startVideo { error in
   guard error == nil else { return }
}

// Stop video.
liveEvent.stopVideo { error in
   guard error == nil else { return }
}

// Switch to a different camera.
liveEvent.switchCamera { error in
   guard error == nil else { return }
}