Closed Bug 1555923 Opened 6 years ago Closed 4 years ago

HTMLMedia​Element​.can​Play​Type() returns false negative for comma-space–separated 'codecs' parameters

Categories

(Core :: Audio/Video: Playback, defect)

68 Branch
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: hugh.guiney, Unassigned)

References

Details

(Keywords: parity-chrome)

Attachments

(2 files)

Attached file Reproduction

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.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
See Also: → 1120764

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?

Flags: needinfo?(hugh.guiney)
Keywords: parity-chrome
Attached file extended testcase

video/webm; codecs=vp8 vorbis is "probably" in Firefox, but empty string in Chrome.

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.

(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?

Flags: needinfo?(hugh.guiney) → needinfo?(karlt)

Yes, thanks. Issue reported no longer exists due to change in Firefox behavior.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(karlt)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: