W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] [mimesniff] Treating application/octet-stream as unknown for sniffing

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 29 Nov 2012 18:24:25 +0000 (UTC)
To: "Gordon P. Hemsley" <gphemsley@gmail.com>
Message-ID: <Pine.LNX.4.64.1211291821030.12469@ps20323.dreamhostps.com>
Cc: whatwg@lists.whatwg.org, Boris Zbarsky <bzbarsky@mit.edu>
On Thu, 29 Nov 2012, Gordon P. Hemsley wrote:
> 
> The apparent contradiction occurs when, e.g., an Opus file is tagged as 
> "application/octet-stream".
> 
> If I understand correctly, a UA would return "" when canPlayType() is 
> called against such a fileā€”but then the file would actually play 
> because it is later sniffed as "application/ogg".

canPlayType() isn't called against files, it's called against MIME type 
strings.

The type "application/octet-stream" isn't a video or audio file type, so 
we know that the browsers can't play files actually of that type, any more 
than the browsers can't play videos of type text/css.

But when a file is labeled with that type, we know it's probably 
mislabeled, so we try to do something more useful.


On another note, the spec's current behavior with media elements and 
sniffing is actually very much up in the air, since the last time I worked 
on this I could not get browser vendors to agree on what to implement. 
Search for the note starting "This specification does not currently say 
whether or how to check the MIME types of the media resources".

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 29 November 2012 19:22:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT