getCapabilities() 方法在 MediaStreamTrack interface returns a MediaTrackCapabilities object which specifies the values or range of values which each constrainable property, based upon the platform and 用户代理 .

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.

句法

const capabilities = track.getCapabilities()
					

返回值

A MediaTrackCapabilities object which specifies the value or range of values which are supported for each of the user agent's supported constrainable properties.

规范

规范 状态 注释
媒体捕获和流
The definition of 'getCapabilities()' in that specification.
候选推荐 初始定义。

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
getCapabilities Chrome 66 Edge 12 Firefox No IE No Opera 53 Safari Yes WebView Android 66 Chrome Android 66 Firefox Android No Opera Android 47 Safari iOS Yes Samsung Internet Android 9.0

图例

完整支持

完整支持

不支持

不支持

元数据

  • 最后修改: