此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

MediaStreamTrack.getCapabilities()

基线 2024
最近可用

自 October 2024 起,此特性已在最新浏览器中得到支持。但在较旧的设备或浏览器中可能无法运行。

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

一旦你知道了浏览器的功能,你的脚本可以通过调用 applyConstraints() 来请求配置为匹配理想或可接受的设置。参考功能、约束和设置以了解受限制属性的具体细节。

语法

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.

规范

规范
Media Capture and Streams
# dom-mediastreamtrack-getcapabilities

浏览器兼容性