Live SDKs Android v1
Live SDKs Android
Live SDKs
Android
Version 1

List live events

Copy link

A user can get a list of ongoing events by using the LiveEventListQuery object. The user can filter their search by host type, created date, participant count, duration, live event ID and more by using the LiveEventListQueryParams object. If the user knows the ID of the live event, the user can directly find the live event by using SendbirdLive.getLiveEvent(liveEventId: String, handler: LiveEventHandler?).

val params = LiveEventListQuery.Params()
val query = SendbirdLive.createLiveEventListQuery(params)
query.next { liveEvents, e ->
   if (e != null){
       return@next
   }
   // Show the list of live events to users in a list view.
}

LiveEventListQueryParams

Copy link
Property nameTypeDescription

types

List

Filters query results to include live events with the specified live event types.

state

LiveEventState

Filters query results to include live events with the specified live event state.

createdAtRange

Range

Filters query results to include live events that were created within the specified range in Unix milliseconds.

participantCountRange

Range

Filters query results to include live events where the number of current participants is within the specified range.

durationRange

Range

Filters query results to include live events whose duration is within the specified range.

liveEventIds

List

Filters query results to include live events with the specified live event IDs.

createdByUserIds

List

Filters query results to include live events that were created by the specified user IDs.

limit

int

Sets the number of rooms to be retrieved at once.

An open channel should be available when a live event is retrieved. In case the open channel isn’t available, call fetchOpenChannel() to fetch the open channel.