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

Manage media during a live event

Once a host starts a live event by calling the startEvent() method, the state changes to ongoing. While the live event is ongoing, the host can perform various actions to manage media such as turning on or off their audio and video, and switching the audio and video source.

liveEvent.muteAudioInput();

// The user must be a host in order to control the media of the live event.
if (liveEvent.myRole !== LiveEventRole.HOST){
    return;
}

// Mute audio input.
liveEvent.muteAudioInput();

// Unmute audio input.
liveEvent.unmuteAudioInput()

// Start video.
liveEvent.startVideo();

// Stop video.
liveEvent.stopVideo();