MediaCapabilities 接口在 媒体能力 API provides information about the decoding abilities of the device, system and browser. The API can be used to query the browser about the decoding abilities of the device based on codecs, profile, resolution, and bitrates. The information can be used to serve optimal media streams to the user and determine if playback should be smooth and power efficient.

The information is accessed through the mediaCapabilities 特性为 Navigator 接口。

方法

MediaCapabilities.encodingInfo()
When passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether encoding such media would be smooth and power efficient .
MediaCapabilities.decodingInfo()
When passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether decoding such media would be smooth and power efficient .

规范

规范 状态 注释
Media Capabilities
The definition of 'MediaCapabilities' 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
MediaCapabilities Chrome 66 Edge ≤79 Firefox 63 IE ? Opera 55 Safari ? WebView Android 66 Chrome Android 66 Firefox Android 63 Opera Android 48 Safari iOS ? Samsung Internet Android 9.0
decodingInfo Chrome 66 Edge ≤79 Firefox 63 IE ? Opera 55 Safari ? WebView Android 66 Chrome Android 66 Firefox Android 63 Opera Android 48 Safari iOS ? Samsung Internet Android 9.0
encodingInfo Chrome 67 Disabled
67 Disabled
Disabled From version 67: this feature is behind the chrome://flags/#enable-experimental-web-platform-features preference (needs to be set to enabled ). To change preferences in Chrome, visit chrome://flags.
Edge ≤79 Disabled
≤79 Disabled
Disabled From version ≤79: this feature is behind the chrome://flags/#enable-experimental-web-platform-features preference (needs to be set to enabled ).
Firefox 63 IE ? Opera ? Safari ? WebView Android No Chrome Android 67 Disabled
67 Disabled
Disabled From version 67: this feature is behind the chrome://flags/#enable-experimental-web-platform-features preference (needs to be set to enabled ). To change preferences in Chrome, visit chrome://flags.
Firefox Android 63 Opera Android ? Safari iOS ? Samsung Internet Android No

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

用户必须明确启用此特征。

用户必须明确启用此特征。

另请参阅

元数据

  • 最后修改:
  1. 媒体能力 API
  2. MediaCapabilities
  3. 方法
    1. decodingInfo()
    2. encodingInfo()
  4. Related pages for Media Capabilities API
    1. MediaCapabilitiesInfo
    2. Screen
    3. ScreenLuminance
    4. mediaCapabilities.decodingInfo()
    5. mediaCapabilities.encodingInfo()

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1