Options
All
  • Public
  • Public/Protected
  • All
Menu

The VideoDeviceManager class is a managing class to manage the video devices and test them out.

Hierarchy

  • VideoDeviceEventEmitter
    • VideoDeviceManager

Index

Constructors

Events

  • Occurs when the camera device list updated

    Parameters

    • event: VIDEO_DEVICE_LIST_UPDATED
    • listener: ((devices: MediaDeviceInfo[]) => void)
        • (devices: MediaDeviceInfo[]): void
        • Parameters

          • devices: MediaDeviceInfo[]

          Returns void

    Returns any

  • Occurs when the current camera device changed

    Parameters

    • event: VIDEO_DEVICE_CHANGED
    • listener: ((deviceId: string) => void)
        • (deviceId: string): void
        • Parameters

          • deviceId: string

          Returns void

    Returns any

Methods

  • clear(): void
  • Clear away side effect.

    Returns void

  • enumerateVideoDevices(skipPermissionCheck?: boolean): Promise<MediaDeviceInfo[]>
  • Enumerates the video devices.

    Parameters

    • skipPermissionCheck: boolean = false

    Returns Promise<MediaDeviceInfo[]>

    The video device list

  • getVideoDevice(deviceId: string): Promise<MediaDeviceInfo>
  • Gets the video-capture device list that is in use.

    Parameters

    • deviceId: string

    Returns Promise<MediaDeviceInfo>

    The media device info or fails otherwise

  • Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

    Parameters

    Returns void

  • safeGetDisplayMedia(constraints?: DisplayMediaStreamConstraints): Promise<MediaStream>
  • Parameters

    • constraints: DisplayMediaStreamConstraints = ...

    Returns Promise<MediaStream>

  • safeGetUserMedia(constraints?: MediaStreamConstraints): Promise<MediaStream>
  • Prompts the user for permission to use a media input which produces a MediaStream with tracks containing the requested types of media.

    Parameters

    • constraints: MediaStreamConstraints = ...

    Returns Promise<MediaStream>

  • Sets the current video device by the device id.

    description

    A successful call of setVideoDevice triggers the VideoDeviceManagerEvent.VIDEO_DEVICE_CHANGED event notification.

    Parameters

    • deviceId: string

      The unique id of the video device

    Returns Promise<ErrorCodeType>

    0 means success or fails otherwise

  • startVideoDeviceTest(mediaTrackConstraints?: boolean | MediaTrackConstraints): Promise<MediaStream>
  • Starts the camera test.

    description

    A successful call of startDeviceTest triggers capturing the video frames from the camera and displaying them in the video view. If the user can see their video that means the camera works properly.

    Parameters

    • mediaTrackConstraints: boolean | MediaTrackConstraints = true

    Returns Promise<MediaStream>

    The video media stream or fails otherwise

  • description

    Stop video test stream

    Returns Promise<ErrorCodeType>

    0 means success or fails otherwise

  • switchVirtualBackground(type: "blur"): Promise<ErrorCodeType>
  • switchVirtualBackground(type: "image", config: string): Promise<ErrorCodeType>
  • replaceStreamTrack(originStream: MediaStream, targetStream: MediaStream, stopOrigin?: any): void
  • description

    replace stream track

    Parameters

    • originStream: MediaStream
    • targetStream: MediaStream
    • Optional stopOrigin: any

    Returns void