NEWDolby Interactivity APIs are now the Dolby.io Communications APIs Learn More >
X

MediaDeviceService

The MediaDeviceService allows the application to manage the devices used during a conference. The service allows checking which camera is used and if the front-facing camera is used by default, switching between the built-in speaker and the built-in receiver and between front and back camera, checking the selected comfort noise level for output devices in Dolby Voice conferences, and changing the comfort noise level.

Accessors

isDefaultFrontFacing

isDefaultFrontFacing: Bool

Checks if the front-facing camera is used by default.

Returns: Bool


isFrontCamera

isFrontCamera: Bool

Checks if the application uses the front-facing (true) or back-facing camera (false).

Returns: Bool

Methods

switchDeviceSpeaker

switchDeviceSpeaker(forceBuiltInSpeaker: Bool, completion: (() -> Void)?)

Switches between the built-in speaker and built-in receiver.

Parameters:

NameTypeDefaultDescription
forceBuiltInSpeakerBool-A boolean that indicates to either use the built-in speaker (true) or the built-in receiver (false).
completion(() -> Void)?nilThe block to execute when the query completes.

switchCamera

switchCamera(completion: (() -> Void)?)

Switches between front and back camera.

Parameters:

NameTypeDefaultDescription
completion(() -> Void)?nilThe block to execute when the query completes.

setComfortNoiseLevel

setComfortNoiseLevel(comfortNoise: MediaEngineComfortNoiseLevel, completion: ((Error?) -> Void)? = nil))

Configures the comfort noise level for output devices in Dolby Voice conferences.

Parameters

NameTypeDescription
comfortNoiseMediaEngineComfortNoiseLevelThe selected comfort noise level.
completion((Error?) -> Void)? = nil))The block to execute when the query completes.

getComfortNoiseLevel

getComfortNoiseLevel(completion: ((MediaEngineComfortNoiseLevel, Error?) -> Void))

Retrieves comfort noise level setting for output devices in Dolby Voice conferences. If there is no connected output device, getComfortNoiseLevel returns the default level.

Parameters

NameTypeDescription
completion((MediaEngineComfortNoiseLevel, Error?) -> Void))The block to execute when the query completes.

Did this page help you?