W3cubDocs

/Web APIs

Navigator: mediaDevices property

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

js

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

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 11 74 74 No No 11 11.0

See also

© 2005–2023 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