WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
UNCONFIRMED
44517
HTMLMediaElement.canPlayType gives false positives in Safari
https://bugs.webkit.org/show_bug.cgi?id=44517
Summary
HTMLMediaElement.canPlayType gives false positives in Safari
Niels Leenheer (HTML5test)
Reported
2010-08-24 05:28:00 PDT
When a codecs parameter is provided and the MIME type is supported, canPlayType() always returns "probably" regardless of the contents of the codecs parameter. This results in false positives and makes it impossible to reliably detect codec support in Safari. For example: v=document.createElement('video'); v.canPlayType('video/mp4') -> maybe // correct v=document.createElement('video'); v.canPlayType('video/mp4; codecs="avc1.42E01E"') -> probably // correct v=document.createElement('video'); v.canPlayType('video/mp4; codecs="theora"') -> probably // incorrect v=document.createElement('video'); v.canPlayType('video/mp4; codecs="iv50"') -> probably // incorrect The canPlayType() function should only return "probably" when the codecs parameter represents an actually supported codec. Unknown codec parameters should return an empty string. See also:
http://rakaz.nl/2010/06/problems-with-html5-video-codec-detection.html
Attachments
Add attachment
proposed patch, testcase, etc.
Niels Leenheer (HTML5test)
Comment 1
2010-08-24 06:02:51 PDT
I filed a similar bug against Chrome:
http://code.google.com/p/chromium/issues/detail?id=53193
The problem is Chrome is slightly different from the problem in Safari. Chrome only accepts codecs parameters that are supported, but allows MIME type and codec mismatches. For example Theora in an MP4 container will return "probably". Unlike Chrome, Safari will also accept codecs parameters that are not supported at all. For example: v=document.createElement('video'); v.canPlayType('video/mp4; codecs="foobar"') -> probably // incorrect
Ahmad Saleem
Comment 2
2023-10-15 06:35:45 PDT
We still fail some WPT Tests for 'canPlayType', so I think this is still applicable:
https://wpt.fyi/results/html/semantics/embedded-content/media-elements/mime-types/canPlayType.html?label=master&label=experimental&aligned=&q=canplaytype
http://wpt.live/html/semantics/embedded-content/media-elements/mime-types/canPlayType.html
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug