MediaDeviceService
The MediaDeviceService allows the application to manage the devices that are used during the conference.
Typical application workflow:
1. The application calls the getEglContext method to get the WebRTC EglBaseContext to share WebRTC mechanisms with the application.
2. Then, the application is able to attach the stream to the specific receiver using the attachMediaStream method. The application can detach the stream by calling the unAttachMediaStream method.
3. The application can also check information about the used cameras through the getCameraContext method. The switchCamera method enables the application to change the current camera to a different camera.
4. The application can check the selected comfort noise level for output devices in Dolby Voice conferences, and change the comfort noise level.
Available in the package com.voxeet.sdk.services.MediaDeviceService.
Methods
getEglContext
▸ getEglContext(): EglBaseInteracts.Context
Gets EglBaseContext
from WebRTC to share WebRTC mechanisms with the application.
Returns: @Nullable EglBaseInteracts.Context - the current EglBaseContext
or a null value if media are not created.
attachMediaStream
▸ attachMediaStream(@NonNull stream
: MediaStream, @NonNull videoSink
: VideoSink): boolean
Attaches a stream to the given receiver.
Note: If a stream is already attached to the receiver, this method will detach it.
Parameters
Name | Type | Description |
---|---|---|
stream | MediaStream | non null valid media stream to attach |
videoSink | VideoSink | non null videosink that will receive updates |
Returns: boolean
unAttachMediaStream
▸ unAttachMediaStream(@NonNull videoSink
: VideoSink): boolean
Detaches the stream from the given videoSink.
Parameters
Name | Type | Description |
---|---|---|
videoSink | VideoSink | non null receiver instance |
Returns: boolean - the release indicator.
switchCamera
▸ switchCamera(): Promise<Boolean>
Switches the current camera to another available camera that is connected to the device. On Android, the second camera exists by default but on other devices, there may be none, one, two, or even more cameras.
It updates the camera provider's information with the new camera type: front or back.
Returns: @NonNull Promise<Boolean> - the promise to resolve.
getCameraContext
▸ getCameraContext(): CameraContext
Retrieves the instance of the camera information.
Returns: @NonNull CameraContext - the CameraContext
setComfortNoiseLevel
▸ setComfortNoiseLevel(level
: ComfortNoiseLevel): void
deprecated
Note: This method is deprecated in SDK 3.7 and replaced with the setComfortNoiseLevel method available in the LocalAudio model.
Configures the comfort noise level for output devices in Dolby Voice conferences.
Parameters
Name | Type | Description |
---|---|---|
level | ComfortNoiseLevel | The selected comfort noise level. |
getComfortNoiseLevel
▸ getComfortNoiseLevel(): ComfortNoiseLevel
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.
Returns: ComfortNoiseLevel - The comfort noise level.
Updated 9 months ago