Codec support probing
canPlayType and isTypeSupported answers across dozens of codecs.
In one line
Can test which video and audio formats your browser can play
canPlayType and isTypeSupported answers across dozens of codecs.
Pattern of supported codecs (H.264, HEVC, AV1, VP9, AC-3, Opus, FLAC) separates browser build and OS. Chrome without proprietary codecs and Chromium builds stand out.
What it can and can't do
What the user does: Nothing. It happens when a page checks for video or audio support
It can
- Ask whether your browser plays formats like H.264, AV1, VP9, or Opus
- Choose a stream that plays without trouble
- Tell browser builds and operating systems apart by the pattern
- Spot Chromium builds that lack some codecs
It cannot
- See your media files
- See what you watched before
- Learn your device model from this alone
- Ask for formats the browser does not know about
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 3 | 2009-09-15 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 3.5 | 2009-06-30 | None |
| Safari | Supported | 4 | 2009-06-08 | None |
| Safari on iPhone | Supported | 3 | 2009-06-17 | None |
| Chrome on Android | Supported | 18 | 2012-06-27 | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | HTMLMediaElement.canPlayType(), MediaSource.isTypeSupported(), MediaRecorder.isTypeSupported() |
| Browser compat keys | api.HTMLMediaElement.canPlayType |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | read fresh on every page load; nothing stored |
| How to take it back | none needed (no grant) |
| Inside an iframe | Readable from cross-origin iframes too (same values) |
Typical flow
- Page script reads the value
- No prompt is shown
Data you get
Shape: object
How often: static per session
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
canPlayType result | enum | None | empty, maybe, probably | per MIME string |
Technical limits
- Does not say hardware acceleration
The story
What it is
Asks the browser which video and audio formats it can play, which paints a picture of your setup.
For you
You never see the question. What you get is a video that plays in the right format and does not stall. The same checks also show a site your browser build and operating system.
For makers
Streaming and calling sites must pick one of many codecs, since the wrong one fails or wastes battery. The pattern of answers also helps separate real browsers from fakes. Fingerprinters use it as a free signal.
Where you see it
| Type | Example | Apps |
|---|---|---|
| video | A streaming site picks AV1 on a new laptop and H.264 on an old one, so you get smooth playback. | Netflix, YouTube |
| games | A cloud gaming page picks the video format your browser can decode quickest to lower input lag. | Xbox Cloud Gaming, GeForce NOW |
| video | A video call tool chooses VP9 or H.264 depending on what the browser supports and how hot the laptop is. | Google Meet, Jitsi |
| music | A web music player picks the best audio format your browser handles. | None named |
| creative | A browser video editor checks which export formats will work on your device. | Clipchamp |
| ads | A video ad server selects the file format that your player can show without a glitch. | None named |
| security | A fraud tool compares the codec list with the browser it claims to be. | None named |
Risks
- Identifies browser build
- Used as a fingerprint input
What the platform says
- MDN: Media Capabilities and codec checks. Developer docs explain how pages check which media formats the browser plays.
Good uses and abuse
Legitimate uses
- Fallback selection
Known abuse
- Browser build fingerprint
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 2.5 | Rough identifying entropy, when known |
Related capabilities
Related
- Media Capabilities. Can ask how well your device plays each video and audio format
Sources
How well checked: Based on official documentation.