We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

MediaStreamConstraints

The MediaStreamConstraints dictionary is used when calling getUserMedia() to specify what kinds of tracks should be included in the returned MediaStream, and, optionally, to establish constraints for those tracks' settings.

To learn more about how constraints work, see Capabilities, constraints, and settings.

Properties

Some combination—but not necessarily all—of the following properties will exist on the object.

Track constraints

video
Either a Boolean (which indicates whether or not a video track is requested) or a MediaTrackConstraints object providing the constraints which must be met by the video track included in the returned MediaStream. If constraints are specified, a video track is inherently requested.
audio
Either a Boolean (which indicates whether or not an audio track is requested) or a MediaTrackConstraints object providing the constraints which must be met by the audio track included in the returned MediaStream. If constraints are specified, an audio track is inherently requested.

Security

peerIdentity
A DOMString identifying the peer who has sole access to the stream. If this property is specified, only the indicated peer can receive and use the stream. Streams isolated in this way can only be displayed in a media element (<audio> or <video>) where the content is protected just as if CORS cross-origin rules were in effect.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support53 ?38 No Yes ?
video Yes ?38 No Yes ?
audio Yes ?38 No Yes ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support5353 ?38 Yes ?6.0
video Yes Yes ?38 Yes ? Yes
audio Yes Yes ?38 Yes ? Yes

See also

Document Tags and Contributors

Contributors to this page: fscholz, Sheppy
Last updated by: fscholz,