Class LiveEvent

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

Hierarchy

Constructors

Properties

_listeners: { disconnected?: EventListener<{ args: [LiveEvent, Error] }>[]; hostConnected?: EventListener<{ args: [LiveEvent, Host] }>[]; hostDisconnected?: EventListener<{ args: [LiveEvent, Host] }>[]; hostEntered?: EventListener<{ args: [LiveEvent, Host] }>[]; hostExited?: EventListener<{ args: [LiveEvent, Host] }>[]; hostMutedAudio?: EventListener<{ args: [LiveEvent, Host] }>[]; hostStartedVideo?: EventListener<{ args: [LiveEvent, Host] }>[]; hostStoppedVideo?: EventListener<{ args: [LiveEvent, Host] }>[]; hostUnmutedAudio?: EventListener<{ args: [LiveEvent, Host] }>[]; liveEventEnded?: EventListener<{ args: [LiveEvent] }>[]; liveEventReady?: EventListener<{ args: [LiveEvent] }>[]; liveEventStarted?: EventListener<{ args: [LiveEvent] }>[]; participantEntered?: EventListener<{ args: [LiveEvent, Participant] }>[]; participantExited?: EventListener<{ args: [LiveEvent, Participant] }>[] } = {}

Type declaration

createdAt: number

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

createdBy: string

User ID of the user that created the live event.

cumulativeParticipantCount: number

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

currentLiveUser: Participant
customItems: Record<string, any>

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

duration: number

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

endedAt: number

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

endedBy: string

User ID of the user that ended the live event.

host: Host

Host of the live event.

isHostStreaming: boolean

Indicates whether the host is streaming media.

liveEventId: string

Unique identifier for the live event.

off: (<K>(type: K, callback: EventListener<LiveEventEventMap[K]>) => void) = ...

Type declaration

on: (<K>(type: K, callback: EventListener<LiveEventEventMap[K]>) => (() => void)) = ...

Type declaration

openChannel: OpenChannel

An open channel that is used for the live event.

participantCount: number

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

peakParticipantCount: number

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

setReadyAt: number

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

setReadyBy: string

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

startedAt: number

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

startedBy: string

User ID of the user that started the live event.

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

userIdsForHost: string[]

Accessors

  • get isActiveHost(): boolean
  • Returns boolean

  • get isHost(): boolean
  • Returns boolean

  • get myRole(): LiveEventRole
  • The role of the user in a live event.

    Returns LiveEventRole

Methods

  • Returns Promise<OpenChannel>

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

    Returns Promise<void>

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

    Returns void

  • Enters a live event.

    Returns Promise<void>

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

    Parameters

    Returns Promise<void>

  • Exits a live event.

    Returns Promise<void>

  • Exits a live event as a host.

    Returns Promise<void>

  • Returns Promise<OpenChannel>

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

    Returns void

  • Selects a device for audio input for a live event. Only the host can perform this action.

    Parameters

    • mediaDeviceInfo: InputDeviceInfo

    Returns void

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

    Parameters

    • mediaDeviceInfo: InputDeviceInfo

    Returns void

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

    Returns Promise<void>

  • Parameters

    • mediaView: HTMLMediaElement
    • hostId: string

    Returns void

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

    Parameters

    Returns Promise<void>

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

    Parameters

    Returns void

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

    Returns void

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

    Returns void

  • Returns void

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

    Returns void

  • Parameters

    Returns void

Generated using TypeDoc