HTMLMediaElement.canPlayType() returns false negative for comma-space–separated 'codecs' parameters
Categories
(Core :: Audio/Video: Playback, defect)
Tracking
()
People
(Reporter: hugh.guiney, Unassigned)
References
Details
(Keywords: parity-chrome)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Steps to reproduce:
Create an HTMLVideoElement “video” with no sources and call video.canPlayType('video/webm; codecs=vp8, vorbis')
(i.e. with a space character after the comma).
Actual results:
Returns the empty string.
Expected results:
Returns the string “probably”, same as if I had called video.canPlayType('video/webm; codecs=vp8,vorbis')
(i.e. with no space after the comma).
As shown in the Examples section of RFC 4281, spaces are allowed in-between commas.
Chrome 74 (latest stable at time of writing) matches expected behavior, returning “probably” regardless of comma or comma-space variant.
![]() |
||
Updated•6 years ago
|
Comment 1•6 years ago
|
||
https://tools.ietf.org/html/rfc4281#section-3 has
Note that, per [MIME-Format], some characters (including the comma used to separate multiple values) require that the entire parameter value be enclosed in quotes.
canPlayType() returns probably when the quotes are provided.
Are you aware of a more recent specification that relaxes this requirement?
Comment 2•6 years ago
|
||
video/webm; codecs=vp8 vorbis
is "probably" in Firefox, but empty string in Chrome.
Comment 3•6 years ago
|
||
My interpretation of https://html.spec.whatwg.org/multipage/media.html#dom-navigator-canplaytype is that a mime type that cannot be parsed would be handled by the 'must return "maybe" otherwise' clause.
![]() |
||
Comment 4•4 years ago
|
||
(In reply to Karl Tomlinson (:karlt) from comment #2)
Created attachment 9069260 [details]
extended testcase
video/webm; codecs=vp8 vorbis
is "probably" in Firefox, but empty string in Chrome.
This test case returns the same results on Chrome and Fx. Karl, can we resolve this out as wfm?
Comment 5•4 years ago
|
||
Yes, thanks. Issue reported no longer exists due to change in Firefox behavior.
Comment 6•3 years ago
|
||
The behavior change was from https://hg.mozilla.org/mozilla-central/rev/d1f68e04245156b28258bed007957176bd4ab4ec
Description
•