MediaStreamTrack.getCapabilities()

MediaStreamTrack 接口的 getCapabilities() 方法返回一个 MediaTrackCapabilities 对象,此对象表示每个可调节属性的值或者范围,该特性依赖于平台和user agent.

一旦你知道了浏览器的功能,你的脚本可以通过调用 applyConstraints() (en-US) 来请求配置为匹配理想或可接受的设置。参考Capabilities and constraints in MediaStream API 以了解受限制属性的具体细节。

语法

var capabilities = MediaStreamTrack.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.

规范

Specification
Media Capture and Streams
# dom-mediastreamtrack-getcapabilities

浏览器兼容性

BCD tables only load in the browser