DeviceTrackerHelper (interface)
Device tracker helper that simplifies handling audio and video device changes during an active call or conference.
Methods
- attachCall
- attachConference
- clear
- disableTracker
- enableTracker
- startPreviewVideo
- startSendingVideo
- stopPreviewVideo
- stopSendingVideo
- togglePreviewVideo
- toggleSendingVideo
- toggleTracker
Properties
Methods
attachCall
attachCall(call: Call): Promise<void>
Connects a conference instance to the device tracker helper. Only one Conference or Call instance can be connected to the device helper.
Parameters
Returns: Promise<void>
attachConference
attachConference(conference: Conference): Promise<void>
Connects a conference instance to the device tracker helper. Only one Conference or Call instance can be connected to the device helper.
Parameters
Returns: Promise<void>
clear
clear(): Promise<void>
Stops all streams managed by the device tracker helper and releases all resources.
Returns: Promise<void>
disableTracker
disableTracker(): void
Disables the helper.
Returns: void
enableTracker
enableTracker(): void
Enables the helper.
Returns: 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: 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: 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: 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: 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: 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: Promise<void>
toggleTracker
toggleTracker(): void
Toggles the helper state (disables it if it is enabled and enables it if it is disabled).
Returns: void
Properties
audioProcessing
audioProcessing: Watchable<AudioProcessingType>
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<VideoConfig>
Watchable property that allows getting and setting the current video configuration for a call or conference.
cameras
cameras: ReadonlyWatchable<InputDevice[]>
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.
When a new camera connects, camera selection remains unchanged (no automatic switch occurs).
When the active camera disconnects:
- DeviceTrackerHelper.shouldSendVideo is set to false
- DeviceTrackerHelper.videoStream is stopped and set to null
- DeviceTrackerHelper.shouldPreviewVideo is set to false
- DeviceTrackerHelper.previewVideoStream is stopped and set to null
- DeviceTrackerHelper.currentCamera is updated to point to an alternative available camera, with a fallback to null if none remain
currentMicrophone
currentMicrophone: Watchable<null | InputDevice>
Watchable property that allows getting and setting and changing the currently active microphone.
When a new microphone is connected:
- audio routing automatically switches to the new microphone (excluding microphones paired with a camera).
- DeviceTrackerHelper.audioStream is updated with the new microphone track and attached to active calls or conferences.
When the active microphone is disconnected:
- the current audio stream stops and is removed from any active call or conference.
- a fallback available microphone is selected automatically.
- DeviceTrackerHelper.audioStream is updated with the fallback microphone track and attached to the active call or conference.
currentSpeaker
currentSpeaker: Watchable<null | OutputDevice>
Watchable property that allows getting and setting the currently active speaker.
When a new speaker is connected:
- audio routing is automatically switched to the new speaker if it is part of a headset, updating all Renderer output devices.
- no automatic switch is performed if the new device is a standalone speaker (e.g., an HDMI display) and a speaker is already active.
- the new speaker is selected automatically if no active speaker was previously selected.
When the active speaker is disconnected:
- DeviceTrackerHelper.currentSpeaker is reassigned to another available speaker, or to null if no alternative exists.
- all Renderer output devices are updated to reflect the change.
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: ReadonlyWatchable<InputDevice[]>
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: ReadonlyWatchable<OutputDevice[]>
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.