MediaStreamTrack: getCapabilities() method
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
getCapabilities()
Parameters
None.
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, containing the following members:
deviceId-
A
ConstrainDOMStringobject containing the device ID. groupId-
A
ConstrainDOMStringobject containing a group ID. autoGainControl-
A
ConstrainBooleanobject reporting if the source can do auto gain control. If the feature can be controlled by a script the source will report both true and false as possible values. channelCount-
A
ConstrainULongcontaining the channel count or range of channel counts. echoCancellation-
A
ConstrainBooleanobject reporting if the source can do echo cancellation. If the feature can be controlled by a script the source will report both true and false as possible values. latency-
A
ConstrainDoublecontaining the latency or range of latencies. noiseSuppression-
A
ConstrainBooleanobject reporting if the source can do noise suppression. If the feature can be controlled by a script the source will report both true and false as possible values. sampleRate-
A
ConstrainULongcontaining the sample rate or range of sample rates. sampleSize-
A
ConstrainULongcontaining the sample size or range of sample sizes. aspectRatio-
A
ConstrainDoublecontaining the video aspect ratio (width in pixels divided by height in pixels) or range of aspect ratios. facingMode-
A
ConstrainDOMStringobject containing the camera facing mode. A camera may report multiple facings, for example "left" and "user". frameRate-
A
ConstrainDoublecontaining the frame rate or range of frame rates which are acceptable. height-
A
ConstrainULongcontaining the video height or range of heights in pixels. width-
A
ConstrainULongcontaining the video width or range of widths in pixels. resizeMode-
A
ConstrainDOMStringobject containing the mode or an array of modes the UA can use to derive the resolution of the video track.
Specifications
| Specification |
|---|
| Media Capture and Streams # dom-mediastreamtrack-getcapabilities |
Browser compatibility
BCD tables only load in the browser
See also
InputDeviceInfo.getCapabilities(), which also return aMediaTrackCapabilitiesobject.