Closed Bug 574936 Opened 14 years ago Closed 13 years ago

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

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

VERIFIED WONTFIX

People

(Reporter: niels, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.3a6pre) Gecko/20100624 Minefield/3.7a6pre

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


Reproducible: Always

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

Actual Results:  
'probably'

Expected Results:  
'maybe'
Sheesh... even I get confused. The sentence above should read:

Both the HTML5 spec and the WebM spec indicate the correct answer should be
'maybe'
This was a deliberate choice. See bug 566245 comment 3. Originally I returned 'maybe' but in review:

"With this patch, we return "maybe" for canPlayType("video/webm") and
canPlayType("audio/webm"). I think we should return "probably". This is the
point of WebM."

The theory being that since webm only has once video and audio codec then it should be 'probably'
I discussed this with Robert O'Callahan today. As you mention in comment 0, the HTML 5 spec does say:

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

The word 'Generally' implies that there a situations where this would not be the case and WebM seems to be one of those situations. The intent of WebM was to provide only video and one audio codec so we can say for sure that we can play a video/webm file. If it contains other codecs it is not a video/webm file.

The webmproject.org mentions that it 'should return maybe' not 'must return maybe' so it seems that it is ok to return probably here also.

I would suggest asking on the webm mailing list if the 'should' really is a 'must' and if it is, why is it the case that it must return 'maybe' when we can guarantee that we can play it given we support the only two codecs that webm requires. There seems no reason for them to require what canPlayType returns.
No plans to change this unless WebM ends up supporting multiple codecs. If that happens please open another bug.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Status: RESOLVED → VERIFIED
> Chris Double wrote:
> No plans to change this unless WebM ends up supporting multiple 
> codecs. If that happens please open another bug.

As requested, I've filed a new bug for this issue:
https://bugzilla.mozilla.org/show_bug.cgi?id=884275
You need to log in before you can comment on or make changes to this bug.