The MediaStream.id() read-only property is a DOMString containing 36 characters denoting a unique identifier (GUID) for the object.

Syntax

var id = mediaStream.id;

Example

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

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

Specifications

Specification Status Comment
Media Capture and Streams
The definition of 'MediaStream.id' in that specification.
Candidate Recommendation Initial definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes — 541241 ? Yes — 39 ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes — 54 Yes — 54 Yes41 Yes — 39 ? Yes

See Also

Document Tags and Contributors

 Contributors to this page: fscholz, libbymc, teoli
 Last updated by: fscholz,