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.
Some combination—but not necessarily all—of the following properties will exist on the object.
video
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
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.peerIdentity
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.Feature | Chrome | Firefox (Gecko) | Microsoft Edge | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 53.0 | 38 (38) | ? | No support | (Yes) | ? |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|
Basic support | ? | 53.0 | 38.0 (38) | No support | ? | ? | 53.0 |
MediaDevices.getUserMedia()
MediaStreamTrack.getConstraints()
MediaStreamTrack.applyConstraints()
MediaDevices.getSupportedConstraints()
MediaTrackSupportedConstraints
MediaStreamTrack.getSettings()
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints