Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for starting or stopping local video capture.

Hierarchy

  • LocalVideoTrack

Index

Methods

  • start(previewDOMElement: VideoPlayer | HTMLVideoElement | HTMLCanvasElement, virtualBackground?: { cropped?: boolean; imageUrl: string }): Promise<void | Error>
  • Starts local video capture and plays it back.

    Parameters

    • previewDOMElement: VideoPlayer | HTMLVideoElement | HTMLCanvasElement

      Video DOM element that will contain the video playback. Canvas and VideoPlayer Element will contain the video with virtual background. we recommend you use the VideoPlayer Element.

    • Optional virtualBackground: { cropped?: boolean; imageUrl: string }

      virtual background setting

      • Optional cropped?: boolean

        Determines whether to crop the background image to an appropriate aspect ratio (16/9), default is false.

      • imageUrl: string

        Image URL for the virtual background.

        • If set to a specific image, the URL can be a regular HTTP or HTTPS URL, base64 format, or ObjectURL.
        • 'blur' : Blurs the background.
        • undefined : no virtual background.

    Returns Promise<void | Error>

  • stop(): Promise<void | Error>
  • Stops local video capture.

    Returns Promise<void | Error>

  • switchCamera(deviceId: string): Promise<void | Error>
  • Switch camera.

    Parameters

    • deviceId: string

      The ID of the camera to switch to or on mobile platform, using facingMode instead.

    Returns Promise<void | Error>

  • updateVirtualBackground(imageUrl?: string, cropped?: boolean): Promise<void | Error>
  • Update the preview virtual background image.

    Parameters

    • Optional imageUrl: string

      Image URL for the virtual background.

    • Optional cropped: boolean

      Determines whether to crop the background image to an appropriate aspect ratio (16/9), default is false.

    Returns Promise<void | Error>