Navigator.mediaDevices
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The Navigator.mediaDevices
read-only property returns a MediaDevices
object, which provides access to connected media input devices like cameras and microphones, as well as screen sharing.
Syntax
var mediaDevices = navigator.mediaDevices;
Return value
The MediaDevices
singleton object. Usually, you just use this object's members directly, such as by calling navigator.mediaDevices.getUserMedia()
.
Specifications
Specification |
---|
Media Capture and Streams # mediadevices |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
mediaDevices |
47 |
12 |
36 |
No |
34 |
11 |
47 |
47 |
36 |
34 |
11 |
5.0 |
secure_context_required |
74 |
79 |
69 |
No |
No |
No |
74 |
74 |
No |
No |
No |
11.0 |
See also
- Media Capture and Streams API: The entry point to the documentation about the entire media stream API.
- WebRTC API: Documentation about the WebRTC API, which is closely related.
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices