MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-dev-survey

MediaStream.id 只读属性,一个包含36个字符的 DOMString ,用来作为这个对象的唯一标识符 (GUID) 。

语法

var id = mediaStream.id;

示例

var p = navigator.mediaDevices.getUserMedia({ audio: true, video: true });

p.then(function(stream) {
   console.log(stream.id);
};)

规范

Specification Status Comment
Media Capture and Streams
MediaStream.id
Editor's Draft Initial definition.

浏览器兼容性

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? (Yes) 41 (41) ? ? ?
Feature Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? (Yes) 41.0 (41) ? ? ?

相关链接

文档标签和贡献者

 此页面的贡献者: Cattla
 最后编辑者: Cattla,