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

NameTypeDescription
streamMediaStreamnon null valid media stream to attach
videoSinkVideoSinknon null videosink that will receive updates

Returns: boolean


unAttachMediaStream

unAttachMediaStream(@NonNull videoSink: VideoSink): boolean

Detaches the stream from the given videoSink.

Parameters

NameTypeDescription
videoSinkVideoSinknon null receiver instance

Returns: boolean - the release indicator.


switchCamera

switchCamera(): Promise

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 - the promise to resolve.


getCameraContext

getCameraContext(): CameraContext

Retrieves the instance of the camera information.

Returns: @NonNull CameraContext - the CameraContext