MediaStreamTrack.getCapabilities()

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

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
getCapabilitiesChrome Full support 66Edge Full support 12Firefox No support NoIE No support NoOpera Full support 53Safari Full support YesWebView Android Full support 66Chrome Android Full support 66Firefox Android No support NoOpera Android Full support 47Safari iOS Full support YesSamsung Internet Android Full support 9.0

Legend

Full support
Full support
No support
No support