Live SDKs JavaScript v1
Live SDKs JavaScript
Live SDKs
JavaScript
Version 1

Enter a live event

Copy link

be specified in userIdsForHost of LiveEventCreateParams when creating a live event. Those who are specified in the userIdsForHost can enter the live event as a host and perform various actions: exit, re-enter, start and end their media stream, change the state of the event, chat in the open channel.

On the other hand, even if a user is specified as a host, the user can still enter the live event as a participant. To enter as a participant, call LiveEvent.enter().

Note: The actions that hosts take are independent of the states of the live event. For example, a host's entering or leaving the event won't change the state of it. A host can exit the live event without ending the live event because endEvent() must be called to completely end the live event. To understand how it works, refer to the leave the live event temporarily page.

try {
    await liveEvent.enterAsHost();
} catch (e) {
    // Handle error.
}

try {
    await liveEvent.exitAsHost();
} catch (e) {
    // Handle error.
}