Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

MediaDevices

Provides access to connected media input devices like cameras and microphones, as well as screen sharing. In essence, it lets you obtain access to any hardware source of media data. Available only in secure contexts.

interface MediaDevices extends EventTarget {
ondevicechange: ((this: MediaDevices, ev: Event) => any) | null;
addEventListener<K extends keyof MediaDevicesEventMap>(
type: K,
listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void;
enumerateDevices(): Promise<MediaDeviceInfo[]>;
getDisplayMedia(constraints?: DisplayMediaStreamConstraints): Promise<MediaStream>;
getSupportedConstraints(): MediaTrackSupportedConstraints;
getUserMedia(constraints?: MediaStreamConstraints): Promise<MediaStream>;
removeEventListener<K extends keyof MediaDevicesEventMap>(
type: K,
listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void;
}
var MediaDevices: {
prototype: MediaDevices;
new (): MediaDevices;
}
;

§Extends

§Properties

§
ondevicechange: ((this: MediaDevices, ev: Event) => any) | null
[src]

§Methods

§
addEventListener<K extends keyof MediaDevicesEventMap>(
type: K,
listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
enumerateDevices(): Promise<MediaDeviceInfo[]>
[src]
§
getDisplayMedia(constraints?: DisplayMediaStreamConstraints): Promise<MediaStream>
[src]
§
getSupportedConstraints(): MediaTrackSupportedConstraints
[src]
§
getUserMedia(constraints?: MediaStreamConstraints): Promise<MediaStream>
[src]
§
removeEventListener<K extends keyof MediaDevicesEventMap>(
type: K,
listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
[src]
§
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
[src]