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

Check the settings of a live event

Copy link

In each live event, up to six users can stream their content as a co-host. After entering a live event as a host using enterAsHost(), the host can view their own media stream before changing the state to ready and allowing participants to enter.

To set up their streaming, each host can specify audio and video devices using the selectVideoInput() and selectAudioInput() methods. When the devices aren't specified, the browser's default device is used. Then, each host can establish a connection with the Sendbird server by calling the startStreaming() method to see their own view. To render the video streams of all hosts to the view, call liveEvent.setVideoViewForLiveEvent(videoView, hostId), where videoView must be of HTMLMediaElement type.

The selectVideoInput() and selectAudioInput() methods accept MediaDeviceInfo as a parameter. You can get MediaDeviceInfo for your devices using getAvailableAudioInputDevices(): MediaDeviceInfo[] and getAvailableVideoInputDevices(): MediaDeviceInfo[].

// Get DeviceInfo list.
SendbirdLive.getAvailableAudioInputDevices();
SendbirdLive.getAvailableVideoInputDevices();

// You can choose audio and video devices to use during the live event. If not specified, the browser's default device is used.  
liveEvent.selectVideoInput(deviceInfo);
liveEvent.selectAudioInput(deviceInfo);

// Set the media for the live event for the host to view their own media stream.
liveEvent.setVideoViewForLiveEvent(videoView, hostId);

// Start streaming.
liveEvent.startStreaming();