LiveEvent

class LiveEvent

A class that provides methods for a host and participants to stream and receive media during a live event.

Since

1.0.0

Functions

Link copied to clipboard
fun addListener(identifier: String, listener: LiveEventListener)

Adds a listener to receive events about a liveEvent.

Link copied to clipboard
fun addVideoFrameListener(listener: VideoFrameListener)

Adds videoFrameListener to receive events about video frames from the Live SDK.

Link copied to clipboard
fun createRTMPStream(handler: RTMPStreamHandler?)

Creates a new RTMP stream. This creates a new RTMP endpoint that you can use as an input for media stream for the live event. A host will be created with the stream type of RTMP and entered to the live event as the host.

Link copied to clipboard
fun deleteAllCustomItems(handler: CustomItemsHandler?)

Deletes all custom items in a live event.

Link copied to clipboard
fun deleteCustomItems(customItemKeys: List<String>, handler: CustomItemsHandler?)

Deletes custom items in a live event by specifying keys.

Link copied to clipboard
fun deleteRTMPStream(rtmpStreamId: String, handler: CompletionHandler?)

Deletes the existing RTMP stream. This will exit the existing host with the RTMP stream type.

Link copied to clipboard
fun endEvent(handler: CompletionHandler?)

Ends a live event. Only the host can perform this action. Calling this method implicitly calls endStreaming.

Link copied to clipboard
fun endStreaming(handler: CompletionHandler?)

Ends media streaming of a host in the live event. Only the host can perform this action.

Link copied to clipboard
fun enqueueExternalVideoFrame(frame: VideoFrame)

Sends the modified video frames from the external video source to the queue. Set to call this method as frequently as needed to stream seamlessly.

Link copied to clipboard
fun enter(handler: CompletionHandler?)

Enters a live event.

Link copied to clipboard
fun enterAsHost(options: MediaOptions, handler: CompletionHandler?)

Enters a live event as a host. Only the host can perform this action.

Link copied to clipboard
fun exit(handler: CompletionHandler?)

Exits a live event.

Link copied to clipboard
fun exitAsHost(handler: CompletionHandler?)

Exits a live event as a host.

Link copied to clipboard
fun fetchCustomItems(handler: CustomItemsHandler?)

Retrieves the latest custom items of a live event.

Link copied to clipboard
fun fetchOpenChannel()

Fetches the associated open channel from Sendbird Chat

Link copied to clipboard
fun getAllReactionCounts(handler: ReactionCountHandler?)

Returns all reaction counts sent during a live event.

Link copied to clipboard
fun increaseReactionCount(key: String, handler: ReactionCountHandler?)

Increase a reaction to the ongoing live event by specifying its key.

Link copied to clipboard
fun muteAudioInput(handler: CompletionHandler?)

Mutes the audio of a live event. Only the host can perform this action.

Link copied to clipboard
fun pauseStreaming()

Pauses audio and video stream during a live event. Use instead of endStreaming() to pause without ending host's media stream. Only the host can perform this action.

Link copied to clipboard
fun removeListener(identifier: String)

Removes a listener to stop receiving events about a room.

Link copied to clipboard
fun resumeStreaming()

Resumes audio and video stream after pausing. Use instead of startStreaming() to resume host's media stream without re-establishing the connection to the server. Only the host can perform this action.

Link copied to clipboard
fun selectAudioDevice(device: AudioDevice, handler: CompletionHandler?)

Selects a device for audio input and output for a live event.

Link copied to clipboard
fun selectVideoDevice(device: VideoDevice, handler: CompletionHandler?)

Selects a device for video output during a live event. Only the host can perform this action.

Link copied to clipboard
fun setConnectionQualityListener(listener: ConnectionQualityListener)

Sets the listener for connection quality and its monitoring modes.

Link copied to clipboard
fun setEventReady(handler: CompletionHandler?)

Sets a live event ready before starting a live event. Only the host can perform this action.

Link copied to clipboard
fun setVideoViewForLiveEvent(view: SendbirdVideoView, hostId: String)

Sets a video view for a live event by showing video stream from the host.

Link copied to clipboard
fun startEvent(options: MediaOptions? = null, handler: CompletionHandler?)

Starts the live event. Only the host can perform this action. Calling this method implicitly calls startStreaming.

Link copied to clipboard
fun startStreaming(options: MediaOptions? = null, handler: CompletionHandler?)

Starts media streaming of a host in the live event. Only the host can perform this action.

Link copied to clipboard
fun startUsingExternalVideo()

Starts streaming using an external video source instead of the default camera on a mobile device. When you call this function, you must call enqueueExternalVideoFrame() as frequently as needed to stream the external frames seamlessly.

Link copied to clipboard
fun startVideo(handler: CompletionHandler?)

Turns on the video of a live event. Only the host can perform this action.

Link copied to clipboard
fun stopUsingExternalVideo()

Stops streaming using an external video source and returns to the default camera on a mobile to stream. When you call this function, all calls to enqueueExternalVideoFrame() will be ignored. You can set another camera to stream by specifying the device on selectVideoDevice().

Link copied to clipboard
fun stopVideo(handler: CompletionHandler?)

Turns off the video of a live event. Only the host can perform this action.

Link copied to clipboard
fun switchCamera(handler: CompletionHandler?)

Switches between the front and back cameras during a live event. Only the host can perform this action.

Link copied to clipboard
fun unmuteAudioInput(handler: CompletionHandler?)

Unmutes the audio of a live event. Only the host can perform this action.

Link copied to clipboard
fun updateCustomItems(customItems: Map<String, String>, handler: CustomItemsHandler?)

Updates custom items in a live event.

Link copied to clipboard
fun updateLiveEventInfo(params: LiveEventUpdateParams, handler: LiveEventHandler?)

Updates live event information. Only the host can perform this action.

Link copied to clipboard
fun updateVideoQualityConstraints(videoQualityConstraints: VideoQualityConstraints, handler: CompletionHandler?)

Update video quality constraints to match given resolution, FPS, and quality degradation preferences.

Properties

Link copied to clipboard
val availableAudioDevices: Set<AudioDevice>

The available audio device of the current host in a live event.

Link copied to clipboard
val availableVideoDevices: List<VideoDevice>

The available video device of the current host in a live event.

Link copied to clipboard
var coverUrl: String?

The URL of the thumbnail image used for a live event.

Link copied to clipboard
var createdAt: Long

The timestamp of when the live event was created, in milliseconds.

Link copied to clipboard
var createdBy: String

User ID of the user that created the live event.

Link copied to clipboard
var cumulativeParticipantCount: Int

The sum of all participants that entered and exited a live event.

Link copied to clipboard
val currentAudioDevice: AudioDevice?

The current audio device of the current host in a live event.

Link copied to clipboard
var currentLiveEventUser: LiveEventUser? = null
Link copied to clipboard
val currentVideoDevice: VideoDevice?

The current video device of the current host in a live event.

Link copied to clipboard
val customItems: Map<String, String>

A unique key-value pair of information stored in a live event.

Link copied to clipboard
val duration: Long

The period from the time when the live event was created to the time the live event was ended.

Link copied to clipboard
var endedAt: Long?

The timestamp of when the live event was ended, in milliseconds.

Link copied to clipboard
var endedBy: String?

User ID of the user that ended the live event.

Link copied to clipboard
val hosts: List<Host>

Hosts of the live event.

Link copied to clipboard
val isActiveHost: Boolean
Link copied to clipboard
var isHostStreaming: Boolean

Indicates whether the host is streaming media.

Link copied to clipboard
var liveEventId: String

Unique identifier for the live event.

Link copied to clipboard
val myRole: LiveEventRole

The role of the user in a live event.

Link copied to clipboard
var openChannel: OpenChannel? = null

An open channel that is used for the live event.

Link copied to clipboard
var participantCount: Int

The number of participants in a live event which is counted by the number of devices and browsers concurrently connected to Sendbird server.

Link copied to clipboard
var peakParticipantCount: Int

The highest number of participantCount measured at a given time during a live event.

Link copied to clipboard
var setReadyAt: Long?

The timestamp of when the live event was set ready, in milliseconds.

Link copied to clipboard
var setReadyBy: String?

User ID of the user that set the live event ready.

Link copied to clipboard
var startedAt: Long?

The timestamp of when the live event was started, in milliseconds.

Link copied to clipboard
var startedBy: String?

User ID of the user that started the live event.

Link copied to clipboard
var state: LiveEventState

The state of a live event. Valid values are created, ready, ongoing, and ended.

Link copied to clipboard
var title: String?

The name of a live event.

Link copied to clipboard
var type: LiveEventType

Type of the live event.

Link copied to clipboard
var userIdsForHost: List<String>