MediaDeviceService
The MediaDeviceService allows the application to manage devices that are used during conferences. The service allows the application to:
- Enumerate audio input and output devices
- Enumerate video input devices
- Enumerate all devices
- Select an audio input and output device
- Select a video input device
- Check the selected comfort noise level for output devices in Dolby Voice conferences and change the comfort noise level.
- Return the selected audio input device, audio output device, and video input device
- Notify about the added, updated, and removed devices
Events
deviceChanged
• deviceChanged(result
: DeviceChangeResult): void
Emitted whenever the local participant adds, updates, or removes an audio or video device during a conference. The event is available only in SDK 3.5 and later.
example
VoxeetSDK.mediaDevice.on('deviceChanged', (result) => {
});
Parameters:
Name | Type | Description |
---|---|---|
result | DeviceChangeResult | Information about the device. |
Returns: void
Accessors
selectedAudioInputDevice
• get selectedAudioInputDevice(): MediaDeviceInfo
Returns the audio input device that is currently used by the local participant. This API is available only in SDK 3.5 and later.
Returns: MediaDeviceInfo
selectedAudioOutputDevice
• get selectedAudioOutputDevice(): MediaDeviceInfo
Returns the audio output device that is currently used by the local participant. This API is available only in SDK 3.5 and later.
Returns: MediaDeviceInfo
selectedVideoInputDevice
• get selectedVideoInputDevice(): MediaDeviceInfo
Returns the video input device that is currently used by the local participant. This API is available only in SDK 3.5 and later.
Returns: MediaDeviceInfo
Methods
enumerateAudioDevices
▸ enumerateAudioDevices(type?
: string): Promise<MediaDeviceInfo[]>
deprecated
Enumerates all audio devices.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
type | string | "input" | The device type, either input or output. |
Returns: Promise<MediaDeviceInfo[]>
enumerateAudioInputDevices
▸ enumerateAudioInputDevices(): Promise<MediaDeviceInfo[]>
Enumerates all audio input devices that are available for the local participant. This method is available only in SDK 3.5 and later.
Returns: Promise<MediaDeviceInfo[]>
enumerateAudioOutputDevices
▸ enumerateAudioOutputDevices(): Promise<MediaDeviceInfo[]>
Enumerates all audio output devices that are available for the local participant. This method is available only in SDK 3.5 and later.
Returns: Promise<MediaDeviceInfo[]>
enumerateDevices
▸ enumerateDevices(): Promise<MediaDeviceInfo[]>
Enumerates all connected audio and video devices that are available for the local participant. This method is available only in SDK 3.5 and later.
Returns: Promise<MediaDeviceInfo[]>
enumerateVideoDevices
▸ enumerateVideoDevices(type?
: string): Promise<MediaDeviceInfo[]>
deprecated
Enumerates all video devices.
Parameters:
Name | Type | Default value | Description |
---|---|---|---|
type | string | "input" | The device type, either input or output. |
Returns: Promise<MediaDeviceInfo[]>
enumerateVideoInputDevices
▸ enumerateVideoInputDevices(): Promise<MediaDeviceInfo[]>
Enumerates video input devices that are available for the local participant. This method is available only in SDK 3.5 and later.
Returns: Promise<MediaDeviceInfo[]>
getComfortNoiseLevel
▸ getComfortNoiseLevel(): Promise<Error | Default | Medium | Low | Off>
deprecated
Note: This method is deprecated in SDK 3.7 and replaced with the getComfortNoiseLevel method available in the LocalAudio model.
Retrieves the comfort noise level setting for output devices in Dolby Voice conferences. This API is only supported on the Desktop SDK and Web SDK 3.5 and later versions.
Returns: Promise<Error | Default | Medium | Low | Off>
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:
Name | Type | Description |
---|---|---|
device | MediaDeviceInfo | string | The 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:
Name | Type | Description |
---|---|---|
device | MediaDeviceInfo | string | The 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:
Name | Type | Description |
---|---|---|
device | MediaDeviceInfo | string | The MediaDeviceInfo interface that contains information about the device. |
Returns: Promise<string>
setComfortNoiseLevel
▸ setComfortNoiseLevel(level
: ComfortNoiseLevel): Promise<any>
deprecated
Note: This method is deprecated in SDK 3.7 and replaced with the setComfortNoiseLevel method available in the LocalAudio model.
Sets the comfort noise level for output devices in Dolby Voice conferences. The local participant can call this method before joining a conference or during a conference. When setComfortNoiseLevel is called before joining, the SDK stores the set value and uses the setting after the participant joins the conference.
This API is only available in Desktop SDK and Web SDK 3.5 and later versions. Using the API on a not supported SDK version results in an error.
Parameters:
Name | Type | Description |
---|---|---|
level | ComfortNoiseLevel | The selected comfort noise level. |
Returns: Promise<void | Error>
Updated 3 months ago