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

Change the state of a live event

Before starting an event, the host can change the event state to ready by calling the setEventReady() method. This action allows participants to enter the event and chat among themselves or with the host. However, at this point, the participants can't receive the host's media streaming yet.

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

List of live event states

StateHostParticipant

Created

Host can create, enter, start, stop, and exit without ending the live event, and configure media settings.

Participants can't enter the live event.

Ready

Host can enter, start, stop, and exit without ending the live event, and view their own media stream.

Participants can enter live event, and use the chat, but can't receive the host's media stream yet.

Ongoing

Host can turn on/off media stream, update live event information, and exit without ending the live event.

Participants can receive the host's media stream, and use the chat.

Ended

Host can end the live event.

Participants are notified that the live event has ended.