MediaStream.id

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.

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

语法

js
var id = mediaStream.id;

示例

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

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

规范

Specification
Media Capture and Streams
# dom-mediastream-id

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
id

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

相关链接