Closed Bug 884275 Opened 6 years ago Closed 6 years ago

canPlayType('video/webm') should report 'maybe' instead of 'probably'

Categories

(Core :: Audio/Video, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: niels, Assigned: j)

References

()

Details

(Keywords: dev-doc-complete, site-compat)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36

Steps to reproduce:

This bug has been filed before and marked as Won't Fix. As per request of Chris Double I am filing this bug again because WebM now supports a second codec. 

That means that it is now a real possibility to encounter WebM files that cannot be played, while canPlayType claims it can play them.

*****

Original text:
When canPlayType() is called with just a MIME type without codecs parameter, it should return 'maybe' instead of 'probably'. Gecko does this for the video/ogg MIME type, but when the WebM MIME type is checked it returns 'probably'.

Both the HTML5 spec and the WebM spec indicate the correct answer should be 'probably':

HTML5 spec 4.8.10.3:
Generally, a user agent should never return "probably" if the type doesn't have a codecs parameter.

WebM spec:
canPlayType function
- canPlayType('video/webm') should return maybe
- canPlayType('audio/webm') should return maybe

A detailed explanation of this problem can be found here:
http://rakaz.nl/2010/06/problems-with-html5-video-codec-detection.html


Steps to reproduce:
1. e = document.createElement('video');
2. e.canPlayType('video/webm');


Actual results:

'probably'



Expected results:

'maybe'
Confirming.

> Both the HTML5 spec and the WebM spec indicate the correct answer should be 'probably':
'maybe'?
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Mac OS X → All
Hardware: x86 → All
Duplicate of this bug: 927474
There's some extra discussion in the duped bug whether it's desirable to have WebM allow anything besides VP8+Vorbis, and what this means wrt to this bug.

I don't see anything in the WebM spec saying that it supports a second codec now, but you are right that the WebM spec actually says to return maybe in the situation where codecs isn't specified.
(In reply to Gian-Carlo Pascutto (:gcp) from comment #4)
> There's some extra discussion in the duped bug whether it's desirable to
> have WebM allow anything besides VP8+Vorbis, and what this means wrt to this
> bug.

I think we did the right thing based on the information available at the time of implementation, but the reality is that Google reneged on the position that WebM is always VP8. They now support VP9, too.

Hence, I think we should change the codecless case to "maybe".
Blocks: 833023
Attachment #8341181 - Flags: review?(giles)
Comment on attachment 8341181 [details] [diff] [review]
canPlayType_video_webm_maybe.patch

Review of attachment 8341181 [details] [diff] [review]:
-----------------------------------------------------------------

This makes me sad, but r+.
Attachment #8341181 - Flags: review?(giles) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/7832b912da92
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Does this need to be backported to all other branches to make sure they don't choke on WebM/VP9 files? (prior, of course, to VP9 support in some future version) If so, would this sort of thing be best done as soon as possible or as late as possible?
Flags: needinfo?
I don't think there's any need to backport this. We've changed our behaviour to match the spec; I don't see releasing this early as a great help to web developers. CanPlayType is already ridiculously vague.

As Henri said in comment #5, we felt the old behaviour was appropriate (and still is now that we support the two new 'allowed' webm codecs!) but we couldn't convince google to avoid the breaking change.
Flags: needinfo?
When Firefox support for VP9 lands, and we support both VP8 and VP9 does this then change back to 'probably'?
It has already landed (bug 833023).
Thanks, Kohei!
(In reply to Scott Baker from comment #13)
> When Firefox support for VP9 lands, and we support both VP8 and VP9 does
> this then change back to 'probably'?

That's a nice thought, but it makes even less sense to expect the doctype to change for VP10 or whatever. We now match both Chrome and the spec recommendation, so this is better for web authors. http://www.webmproject.org/docs/container/#canplaytype-function

We do return 'probably' if you specify a codec, which is the right thing to do with multi-codec containers.

var v = document.createElement('video');
v.canPlayType('video/webm');
"maybe"
v.canPlayType('video/webm; codecs=vp8');
"probably"
v.canPlayType('video/webm; codecs=vp9');
"probably"
v.canPlayType('video/webm; codecs=vp10');
""
You need to log in before you can comment on or make changes to this bug.