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
Candidate Recommendation Initial definition.

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

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,