Live JavaScript v1
Live JavaScript
Live
JavaScript
Home
/
Live
/
JavaScript
/
SDK

Enter a live event

Once a host has entered the live event, the host can exit, re-enter, start, and end their media stream, and change the state of the event. The host can also chat in the open channel.

Note: The actions that the host can take are independent of the states of the live event. The host can exit the live event without ending the live event if they leave the live event temporarily. To exit the live event and end the streaming, the host must end a live event by calling endEvent().

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

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