Live iOS v1
Live iOS
Live
iOS
Home
/
Live
/
iOS
/
SDK

Manage media during a live event

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

// 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 }
}