Navigator: thuộc tính mediaCapabilities
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
Thuộc tính chỉ đọc mediaCapabilities của giao diện Navigator tham chiếu đến đối tượng MediaCapabilities có thể hiển thị thông tin về khả năng giải mã và mã hóa cho một định dạng phương tiện và khả năng đầu ra nhất định.
Giá trị
Đối tượng MediaCapabilities.
Ví dụ
js
navigator.mediaCapabilities
.decodingInfo({
type: "file",
audio: {
contentType: "audio/mp3",
channels: 2,
bitrate: 132700,
samplerate: 5200,
},
})
.then((result) => {
console.log(
`This configuration is ${result.supported ? "" : "not "}supported,`,
);
console.log(`${result.smooth ? "" : "not "}smooth, and`);
console.log(`${result.powerEfficient ? "" : "not "}power efficient.`);
});
Thông số kỹ thuật
| Specification |
|---|
| Media Capabilities> # dom-navigator-mediacapabilities> |