Navigator.mediaDevices
mediaDevices 是 Navigator 只读属性,返回一个
MediaDevices
对象,该对象可提供对相机和麦克风等媒体输入设备的连接访问,也包括屏幕共享。语法
var mediaDevices = navigator.mediaDevices;
返回值
MediaDevices
是一个单例对象。通常,您只需直接使用此对象的成员,例如通过调用navigator.mediaDevices.getUserMedia()
(en-US)。
规范
Specification |
---|
Media Capture and Streams # mediadevices |
浏览器兼容性
BCD tables only load in the browser
参考阅读
- 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.