CameraController

Hierarchy

  • EventTarget
    • CameraController

Constructors

Properties

cameraFrameRate: number = 0
cameraHeight: number = 0
cameraStream: null | MediaStream = null
cameraWidth: number = 0
mediaDevices: MediaDevice[] = []
selectedDeviceId: string = ''
settingsInputIds: string[] = ...
standardSettingsIds: string[] = ...
videoTrackCapabilities: VideoTrackCapabilities = {}

Methods

  • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

    MDN Reference

    Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optionaloptions: boolean | AddEventListenerOptions

    Returns void

  • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

    MDN Reference

    Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optionaloptions: boolean | AddEventListenerOptions

    Returns void

  • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

    MDN Reference

    Parameters

    • event: Event

    Returns boolean

  • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

    MDN Reference

    Parameters

    • event: Event

    Returns boolean

  • Enumerates the list of video input devices

    The label field for each MediaDevice will be empty if the permission is not equal to granted

    Returns Promise<MediaDevice[]>

  • Return VideoTrackCapabilities

    Returns VideoTrackCapabilities

  • Populates the list of mediaDevices and sets selectedDeviceId

    If camera permission granted it will populate mediaDevices with the list of available cameras and sets selectedDeviceId to that of the first available camera.

    If camera permission is blocked, it will set mediaDevices to [] and selectedDeviceId to an empty string

    Returns Promise<void>

  • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

    MDN Reference

    Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optionaloptions: boolean | EventListenerOptions

    Returns void

  • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

    MDN Reference

    Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optionaloptions: boolean | EventListenerOptions

    Returns void

  • Requests camera permissions from the user.

    Returns Promise<RequestPermissionResult>

    Promise

  • Change selected media device Id

    Parameters

    • deviceId: string

    Returns void

  • Start camera

    Parameters

    • frameWidth: number
    • frameHeight: number
    • OptionalfacingMode: "user" | "environment"

    Returns Promise<boolean>

  • Stop camera

    Returns void

  • Returns void