MediaDeviceService

The MediaDeviceService allows the application to manage devices that are used during conferences. The service allows the application to:

Events

deviceChanged

deviceChanged(result: DeviceChangeResult): void

Emitted whenever the local participant adds, updates, or removes an audio or video device during a conference.

example

VoxeetSDK.mediaDevice.on('deviceChanged', (result) => {

});

Parameters:

NameTypeDescription
resultDeviceChangeResultInformation about the device.

Returns: void

Accessors

selectedAudioInputDevice

• get selectedAudioInputDevice(): MediaDeviceInfo

Returns the audio input device that is currently used by the local participant.

Returns: MediaDeviceInfo


selectedAudioOutputDevice

• get selectedAudioOutputDevice(): MediaDeviceInfo

Returns the audio output device that is currently used by the local participant.

Returns: MediaDeviceInfo


selectedVideoInputDevice

• get selectedVideoInputDevice(): MediaDeviceInfo

Returns the video input device that is currently used by the local participant.

Returns: MediaDeviceInfo

Methods

enumerateAudioInputDevices

enumerateAudioInputDevices(): Promise<MediaDeviceInfo[]>

Enumerates all audio input devices that are available for the local participant.

Returns: Promise<MediaDeviceInfo[]>


enumerateAudioOutputDevices

enumerateAudioOutputDevices(): Promise<MediaDeviceInfo[]>

Enumerates all audio output devices that are available for the local participant.

Returns: Promise<MediaDeviceInfo[]>


enumerateDevices

enumerateDevices(): Promise<MediaDeviceInfo[]>

Enumerates all connected audio and video devices that are available for the local participant.

Returns: Promise<MediaDeviceInfo[]>


enumerateVideoInputDevices

enumerateVideoInputDevices(): Promise<MediaDeviceInfo[]>

Enumerates video input devices that are available for the local participant.

Returns: Promise<MediaDeviceInfo[]>


selectAudioInput

selectAudioInput(device: MediaDeviceInfo | string): Promise<string>

Selects a specific local participant's audio input device for capturing audio during a conference. A joining participant can either use the default audio device or select a different device. All operating systems recognize one default device, however on Windows there is an additional device called the default communication device. Selecting an audio device by providing the communications (only on Windows) or default deviceId causes that the SDK uses the selected device as long as the device is recognized by the operating system as the default device. After changing the default device in the system settings or disconnecting the current default device, the SDK switches to the new default device. When the participant selects the audio device by providing the actual deviceId, the SDK uses the selected device as long as it is available. After disconnecting the selected device, the SDK switches to the default device.

Calling this method by a participant who sends audio from a custom track results in switching their audio source to the default microphone.

Parameters:

NameTypeDescription
deviceMediaDeviceInfo | stringThe MediaDeviceInfo interface that contains information about the device.

Returns: Promise<string>


selectAudioOutput

selectAudioOutput(device: MediaDeviceInfo | string): Promise<string>

Selects a specific local participant's audio output device for playing audio during a conference. A joining participant can either use the default audio device or select a different device. All operating systems recognize one default device, however on Windows there is an additional device called the default communication device. Selecting an audio device by providing the communications (only on Windows) or default deviceId causes that the SDK uses the selected device as long as the device is recognized by the operating system as the default device. After changing the default device in the system settings or disconnecting the current default device, the SDK switches to the new default device. When the participant selects the audio device by providing the actual deviceId, the SDK uses the selected device as long as it is available. After disconnecting the selected device, the SDK switches to the default device.

This method is currently supported only on Chrome and Edge on desktop operating systems.

Parameters:

NameTypeDescription
deviceMediaDeviceInfo | stringThe MediaDeviceInfo interface that contains information about the device.

Returns: Promise<string>


selectVideoInput

selectVideoInput(device: MediaDeviceInfo | string): Promise<string>

Selects a specific local participant's video input device for capturing video during a conference.

Parameters:

NameTypeDescription
deviceMediaDeviceInfo | stringThe MediaDeviceInfo interface that contains information about the device.

Returns: Promise<string>