The MediaDevices interface 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.

Documentation MediaDevices by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Variables

ondevicechange:Function

The event handler for the devicechange event. This event is delivered to the MediaDevices object when a media input or output device is attached to or removed from the user's computer.

Methods

Inherited Variables

Inherited Methods

Defined by EventTarget

addEventListener(type:String, listener:Function, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

addEventListener(type:String, listener:EventListener, ?options:EitherType<AddEventListenerOptions, Bool>, ?wantsUntrusted:Bool):Void

Register an event handler of a specific event type on the EventTarget.

Throws:

null

DOMError

dispatchEvent(event:Event):Bool

Dispatch an event to this EventTarget.

Throws:

null

DOMError

removeEventListener(type:String, listener:Function, ?options:EitherType<EventListenerOptions, Bool>):Void

removeEventListener(type:String, listener:EventListener, ?options:EitherType<EventListenerOptions, Bool>):Void

Removes an event listener from the EventTarget.

Throws:

null

DOMError