The getCapabilities()
method of the MediaStreamTrack
interface returns a MediaTrackCapabilities
object which specifies the values or range of values which each constrainable property, based upon the platform and user agent.
Once you know what the browser's capabilities are, your script can use applyConstraints()
to ask for the track to be configured to match ideal or acceptable settings. See Capabilities, constraints, and settings for details on how to work with constrainable properties.
Syntax
const capabilities = track.getCapabilities()
Return value
A MediaTrackCapabilities
object which specifies the value or range of values which are supported for each of the user agent's supported constrainable properties.
Specifications
Specification | Status | Comment |
---|---|---|
Media Capture and Streams The definition of 'getCapabilities()' in that specification. |
Candidate Recommendation | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getCapabilities | Chrome Full support 66 | Edge Full support 12 | Firefox No support No | IE No support No | Opera Full support 53 | Safari Full support Yes | WebView Android Full support 66 | Chrome Android Full support 66 | Firefox Android No support No | Opera Android Full support 47 | Safari iOS Full support Yes | Samsung Internet Android Full support 9.0 |
Legend
- Full support
- Full support
- No support
- No support