Rate this page:

DeviceTrackerHelper

Device tracker helper that simplifies handling audio and video device changes during an active call or conference.

Methods

attachCall

Copy URL
attachCall(call: 

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

    Call instance

Returns

  • type:

    void

attachConference

Copy URL
attachConference(conference: 

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

Returns

  • type:

    void

clear

Copy URL
clear(): 

void

Stops all streams managed by the device tracker helper and releases all resources.

Returns

  • type:

    void

disableTracker

Copy URL
disableTracker(): 

void

Disables the helper.

Returns

  • type:

    void

enableTracker

Copy URL
enableTracker(): 

void

Enables the helper.

Returns

  • type:

    void

startPreviewVideo

Copy URL
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

Copy URL
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

Copy URL
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

Copy URL
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

Copy URL
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

Copy URL
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

Copy URL
toggleTracker(): 

void

Toggles the helper state (disables it if it is enabled and enables it if it is disabled).

Returns

  • type:

    void

Props

audioProcessing

Copy URL
audioProcessing: 

Watchable<AudioProcessingType>

Watchable property that allows getting and setting the audio processing type.

audioStream

Copy URL
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

Copy URL
bypassAudioProcessing: 

Watchable<boolean>

Watchable property that indicates if the audio processing should be applied.

Affects only AudioProcessingType.Balanced and AudioProcessingType.Aggressive processing types.

cameraConfig

Copy URL
cameraConfig: 

Watchable<VideoConfig>

Watchable property that allows getting and setting the current video configuration for a call or conference.

cameras

Copy URL
cameras: 

ReadonlyWatchable<InputDevice[]>

Watchable property that allows getting the list of currently available camera devices.

currentCamera

Copy URL
currentCamera: 

Watchable<null | InputDevice>

Watchable property that allows getting and setting the currently active camera.

currentMicrophone

Copy URL
currentMicrophone: 

Watchable<null | InputDevice>

Watchable property that allows getting and setting and changing the currently active microphone.

currentSpeaker

Copy URL
currentSpeaker: 

Watchable<null | OutputDevice>

Watchable property that allows getting and setting the currently active speaker.

enabled

Copy URL
enabled: 

boolean

Whether the helper is enabled.

id

Copy URL
id: 

string

Instance id.

isAudioStreamUpdating

Copy URL
isAudioStreamUpdating: 

ReadonlyWatchable<boolean>

Watchable property that allows observing if a local audio stream is currently being updated.

isPreviewVideoStreamUpdating

Copy URL
isPreviewVideoStreamUpdating: 

ReadonlyWatchable<boolean>

Watchable property that allows observing if a video stream for a local preview is currently being updated.

isVideoStreamUpdating

Copy URL
isVideoStreamUpdating: 

ReadonlyWatchable<boolean>

Watchable property that allows observing if a local video stream is currently being updated.

microphones

Copy URL
microphones: 

ReadonlyWatchable<InputDevice[]>

Watchable property that allows getting the list of currently available microphone devices.

previewVideoStream

Copy URL
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

Copy URL
shouldPreviewVideo: 

Watchable<boolean>

Watchable property that allows starting or stopping a preview video stream.

shouldSendVideo

Copy URL
shouldSendVideo: 

Watchable<boolean>

Watchable property that allows getting and setting the video sending status in a call or conference.

speakers

Copy URL
speakers: 

ReadonlyWatchable<OutputDevice[]>

Watchable property that allows getting the list of currently available speaker devices.

videoStream

Copy URL
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.