Live SDKs iOS v1
Live SDKs iOS
Live SDKs
Version 1

Enter a live event

Copy link

A user can enter any live events that are in ready or ongoing states by calling liveEvent.enter(). When a user enters a live event, the user is counted as a participant.

When a user enters a live event that is ready, they can chat but can't watch the event yet because the host's media stream isn't available to them. When users enter an ongoing live event, they can chat and watch the event when the host starts streaming.

In a live event that supports video streaming, you must provide a view for users to watch the live event when they enter the event. To watch the media content streamed from the host, set the video view by calling liveEvent.setVideoViewForLiveEvent(view:hostId:).

// Provide a video view to show the live event.
liveEvent.enter { error in
   guard error == nil else { return } // Failed to join a live event.
// Show the live event video view controller.

For a participant to receive the video view of the host who starts the live event, set the video view using When a different user becomes a host during the live event, subscribe to LiveEventListener.didHostEnter(_:host:) and set the video using host.hostId to view the new host's video.

For the best experience, here are some components included in the SDK that you can use in creating the participant view.