navigator.mediaCapabilities is the entry point for the Media Capabilities API. Learn decodingInfo / encodingInfo, the supported · smooth · powerEfficient result flags, adaptive media tips, five examples, and try-it labs.
01
Kind
Read-only property
02
Returns
MediaCapabilities
03
Baseline
Widely available
04
Decode
decodingInfo()
05
Encode
encodingInfo()
06
Result
supported · smooth · power
Fundamentals
Introduction
Streaming apps often ask: Can this device play H.264 1080p smoothly without draining the battery? Older helpers like canPlayType() only give a rough “maybe.”
navigator.mediaCapabilities returns a MediaCapabilities object. You pass a media configuration (codec, bitrate, resolution, and so on) to decodingInfo() or encodingInfo() and get a Promise with three booleans: supported, smooth, and powerEfficient.
💡
Pick the best stream, not just any stream
Use the API before choosing a quality ladder rung — prefer a lower bitrate when smooth or powerEfficient is false, even if the format is technically supported.
Concept
Understanding the mediaCapabilities Property
Think of it as a “media hardware interview” for the browser: you describe a clip, and it answers whether it can play (or encode) that clip well.
Entry point — navigator.mediaCapabilities (also on WorkerNavigator).
Main methods — decodingInfo(config) and encodingInfo(config).
Config — includes type ("file", "media-source", …) plus audio and/or video details.
Result flags — supported, smooth, powerEfficient.
Baseline — Widely available across modern browsers (MDN, since about January 2020).
Foundation
📝 Syntax
General form of the property:
JavaScript
navigator.mediaCapabilities
Value
A MediaCapabilities object with decodingInfo() and encodingInfo().
Common patterns
JavaScript
// Feature detect:
if ("mediaCapabilities" in navigator) {
// Media Capabilities API available
}
// MDN-style audio decoding check:
navigator.mediaCapabilities
.decodingInfo({
type: "file",
audio: {
contentType: "audio/mp3",
channels: 2,
bitrate: 132700,
samplerate: 5200
}
})
.then(function (result) {
console.log("supported:", result.supported);
console.log("smooth:", result.smooth);
console.log("powerEfficient:", result.powerEfficient);
});
Cheat Sheet
⚡ Quick Reference
Goal
Code
Get the API object
navigator.mediaCapabilities
Feature detect
"mediaCapabilities" in navigator
Decode check
navigator.mediaCapabilities.decodingInfo(config)
Encode check
navigator.mediaCapabilities.encodingInfo(config)
Result fields
supported, smooth, powerEfficient
Status (MDN)
Baseline Widely available
Snapshot
🔍 At a Glance
Four facts to remember about navigator.mediaCapabilities.
Returns
MediaCapabilities
API entry
Baseline
widely
Since ~Jan 2020
Async
Promise
decodingInfo
Answers
3 flags
support · smooth · power
Compare
📋 mediaCapabilities vs canPlayType()
mediaCapabilities
canPlayType()
Question
Supported + smooth + power efficient?
Can the element play this type?
Answer shape
Booleans via Promise
"" / "maybe" / "probably"
Detail level
Codec, bitrate, size, framerate…
Mostly MIME / codec string
Best for
Adaptive streaming quality choice
Quick “is this MIME OK?” checks
MDN guidance
Media Capabilities improves on canPlayType / isTypeSupported for quality decisions
Hands-On
Examples Gallery
Examples follow MDN Media Capabilities patterns with decodingInfo. Prefer Try It Yourself — results depend on your device and browser.
📚 Getting Started
Detect the API and run the classic MDN audio check.
Example 1 — Feature Detection
Check whether navigator.mediaCapabilities exists before calling it.
JavaScript
const supported = "mediaCapabilities" in navigator;
console.log(supported
? "Media Capabilities API available"
: "Media Capabilities API missing");
navigator.mediaCapabilities is Baseline Widely available across modern browsers (MDN: since about January 2020). Use decodingInfo / encodingInfo to choose media that stays smooth and power efficient.
✓ Baseline · Widely available
Navigator.mediaCapabilities
Query decode/encode ability for a config, then pick streams using supported, smooth, and powerEfficient.
UniversalWidely available
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
mediaCapabilitiesExcellent
Bottom line: Feature-detect, call decodingInfo with a realistic config, and fall back when supported or smooth is false.
Wrap Up
Conclusion
navigator.mediaCapabilities opens the Media Capabilities API. Pass a media configuration to decodingInfo or encodingInfo, read supported / smooth / powerEfficient, and choose a stream that fits the device — not just one that “might” play.
Feature-detect with "mediaCapabilities" in navigator
Include realistic bitrate, size, and framerate in configs
Prefer smooth + powerEfficient rungs on mobile
Catch errors from invalid configuration objects
Keep a playable fallback when the best rung fails
❌ Don’t
Rely only on canPlayType for quality decisions
Assume every device reports the same flags for AV1 / HEVC
Block the UI — await the Promise asynchronously
Treat estimates as absolute lab measurements
Skip testing on real low-end phones
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about mediaCapabilities
Baseline Media Capabilities entry — query decode/encode quality before streaming.
5
Core concepts
🎥01
Returns
MediaCapabilities
Entry
🔊02
Method
decodingInfo
Decode
⚡03
Flags
3 booleans
Result
📈04
Use
Pick streams
ABR
✅05
Status
Baseline
Wide
❓ Frequently Asked Questions
It is a read-only Navigator property that returns a MediaCapabilities object. You use decodingInfo() and encodingInfo() to ask whether a media configuration is supported, smooth, and power efficient.
No. MDN marks it Baseline Widely available (since about January 2020). It is not Deprecated, Experimental, or Non-standard.
supported means the browser can handle the configuration. smooth means playback should stay fluid at that quality. powerEfficient means decoding/encoding is expected to use hardware efficiently and save battery when possible.
HTMLMediaElement.canPlayType() and MediaSource.isTypeSupported() mainly answer “maybe / probably / yes.” Media Capabilities also estimates smoothness and power efficiency so you can pick a better stream, not only a playable one.
Yes. WorkerNavigator also exposes mediaCapabilities, so you can run capability checks off the main thread.
No. It is read-only. You call methods on the MediaCapabilities object; you do not assign a new value to navigator.mediaCapabilities.
Did you know?
MDN positions Media Capabilities as an upgrade over canPlayType() and MediaSource.isTypeSupported() — because “playable” is not the same as “smooth and battery-friendly.”