MediaDecodingConfiguration - Web APIs 编辑
The MediaDecodingConfiguration
dictionary of the Media Capabilities API is used to define the type of media being tested when calling MediaCapabilities.decodingInfo()
to query whether a specific media configuration is supported, smooth, and/or power efficient.
Properties
A MediaDecodingConfiguration
dictionary takes two properties:
type
— the type of media being tested. This takes one of two values:file
: Represents a configuration that is meant to be used for a plain file playback.media-source
: Represents a configuration that is meant to be used for playback of aMediaSource
.
- A media configuration — a
VideoConfiguration
orAudioConfiguration
dictionary.
Examples
//Create media configuration to be tested
const mediaConfig = {
type : 'file', // or 'media-source'
video : {
contentType : "video/webm;codecs=vp8", // valid content type
width : 800, // width of the video
height : 600, // height of the video
bitrate : 10000, // number of bits used to encode 1s of video
framerate : 30 // number of frames making up that 1s.
}
};
// check support and performance
navigator.mediaCapabilities.decodingInfo(mediaConfig).then(result => {
console.log('This configuration is ' + (result.supported ? '' : 'not ') + 'supported.')
});
Specifications
Specification | Status | Comment |
---|---|---|
Media Capabilities The definition of 'MediaDecodingConfiguration' in that specification. | Draft | Initial definition |
See also
MediaConfiguration
MediaEncodingConfiguration
HTMLMediaElement.canPlayType()
for fileMediaSource.isTypeSupported()
for media-source
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论