Live SDKs Android v1
Live SDKs Android
Live SDKs
Android
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, a view object must be provided 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.setVideoView(videoView).

// Provide a video view to show the live event.
liveEvent.enter { /* it: SendbirdException */
   if (it != null) {
       return@enter // 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 liveEvent.host.hostId. When a different user becomes a host during the live event, subscribe to LiveEventListener.onHostEntered() and set the video using liveEvent.host.Id 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.