Optionaloptions: boolean | AddEventListenerOptionsThe addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsThe dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
Enumerates the list of video input devices
The label field for each MediaDevice will be empty if the permission
is not equal to granted
Return 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
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
Optionaloptions: boolean | EventListenerOptionsThe removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
Optionaloptions: boolean | EventListenerOptionsRequests camera permissions from the user.
Promise
Change selected media device Id
Starts the camera.
Camera selection is performed using one of the following methods:
facingMode is provided, the browser selects a camera matching the
requested facing direction (user or environment). When multiple cameras
satisfy the requested facing mode, the browser decides which camera to open.facingMode is not provided, the currently selected camera
(selectedDeviceId) is opened.After a camera is successfully opened, selectedDeviceId is updated to the
deviceId of the active camera when available. This allows a camera selected
via facingMode to be reopened later using its exact deviceId.
Desired frame width. Must use a 16:9 aspect ratio.
Desired frame height. Must use a 16:9 aspect ratio.
OptionalfacingMode: "user" | "environment"Optional camera facing direction. When provided, camera
selection is performed by facing mode instead of selectedDeviceId.
true if the camera was opened successfully; otherwise false.
Stop camera
Staticinit
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