DeviceTrackerHelper
Device tracker helper that simplifies handling audio and video device changes during an active call or conference.
Methods
attachCall
attachCall(call: ): void
Connects a conference instance to the device tracker helper. Only one Conference or Call instance can be connected to the device helper.
Parameters
call:
Call instance
Returns
type:
void
attachConference
attachConference(conference: ): void
Connects a conference instance to the device tracker helper. Only one Conference or Call instance can be connected to the device helper.
Parameters
conference:
Conference instance
Returns
type:
void
clear
clear(): void
Stops all streams managed by the device tracker helper and releases all resources.
Returns
type:
void
disableTracker
disableTracker(): void
Disables the helper.
Returns
type:
void
enableTracker
enableTracker(): void
Enables the helper.
Returns
type:
void
startPreviewVideo
startPreviewVideo(): Promise<void>
Creates a local video stream for the local preview.
Returns a promise that is resolved when the operation is completed.
If the operation is completed successfully, DeviceTrackerHelper.previewVideoStream is updated.
Returns
type:
Promise<void>
startSendingVideo
startSendingVideo(): Promise<void>
Starts sending video to a call or conference.
Returns a promise that is resolved when the operation is completed.
This method does not throw an error in case of a failure, however, in this case DeviceTrackerHelper.shouldSendVideo is not changed.
Returns
type:
Promise<void>
stopPreviewVideo
stopPreviewVideo(): Promise<void>
Closes a local video stream created for the local preview and releases its resources.
Returns a promise that is resolved when the operation is completed.
Returns
type:
Promise<void>
stopSendingVideo
stopSendingVideo(): Promise<void>
Stops sending video to a call or conference.
Returns a promise that is resolved when the operation is completed.
This method does not throw an error in case of a failure, however, in this case DeviceTrackerHelper.shouldSendVideo is not changed.
Returns
type:
Promise<void>
togglePreviewVideo
togglePreviewVideo(): Promise<void>
Creates or closes a local video stream for the local preview.
Returns a promise that is resolved when the operation is completed.
Returns
type:
Promise<void>
toggleSendingVideo
toggleSendingVideo(): Promise<void>
Toggles the video sending state in a call or conference (starts sending video if the video is not sent or stops sending video if it is currently being sent).
Returns a promise that is resolved when the operation is completed.
This method does not throw an error in case of a failure, however, in this case DeviceTrackerHelper.shouldSendVideo is not changed.
Returns
type:
Promise<void>
toggleTracker
toggleTracker(): void
Toggles the helper state (disables it if it is enabled and enables it if it is disabled).
Returns
type:
void
Props
audioProcessing
audioProcessing:
Watchable property that allows getting and setting the audio processing type.
audioStream
audioStream: ReadonlyWatchable<null | LocalStream>
Watchable property that allows getting the currently active local audio stream and observe its changes.
The audio stream updates if:
- the audio processing type changed
- the current microphone has changed
- the current microphone has been detached from the device
- a new headset attached
bypassAudioProcessing
bypassAudioProcessing: Watchable<boolean>
Watchable property that indicates if the audio processing should be applied.
Affects only AudioProcessingType.Balanced and AudioProcessingType.Aggressive processing types.
cameraConfig
cameraConfig:
Watchable property that allows getting and setting the current video configuration for a call or conference.
cameras
cameras:
Watchable property that allows getting the list of currently available camera devices.
currentCamera
currentCamera: Watchable<null | InputDevice>
Watchable property that allows getting and setting the currently active camera.
currentMicrophone
currentMicrophone: Watchable<null | InputDevice>
Watchable property that allows getting and setting and changing the currently active microphone.
currentSpeaker
currentSpeaker: Watchable<null | OutputDevice>
Watchable property that allows getting and setting the currently active speaker.
enabled
enabled: boolean
Whether the helper is enabled.
id
id: string
Instance id.
isAudioStreamUpdating
isAudioStreamUpdating: ReadonlyWatchable<boolean>
Watchable property that allows observing if a local audio stream is currently being updated.
isPreviewVideoStreamUpdating
isPreviewVideoStreamUpdating: ReadonlyWatchable<boolean>
Watchable property that allows observing if a video stream for a local preview is currently being updated.
isVideoStreamUpdating
isVideoStreamUpdating: ReadonlyWatchable<boolean>
Watchable property that allows observing if a local video stream is currently being updated.
microphones
microphones:
Watchable property that allows getting the list of currently available microphone devices.
previewVideoStream
previewVideoStream: ReadonlyWatchable<null | LocalStream>
Watchable property that allows getting a video stream preview.
The preview video stream is not sending in a call or conference, but may be used to show the local preview before a call or conference starts or in the video settings of the active call or conference.
shouldPreviewVideo
shouldPreviewVideo: Watchable<boolean>
Watchable property that allows starting or stopping a preview video stream.
shouldSendVideo
shouldSendVideo: Watchable<boolean>
Watchable property that allows getting and setting the video sending status in a call or conference.
speakers
speakers:
Watchable property that allows getting the list of currently available speaker devices.
videoStream
videoStream: ReadonlyWatchable<null | LocalStream>
Watchable property that allows getting the currently active local video stream and observe its changes.
The video stream is set to null and removed from the call/conference if the current input device detach.