[whatwg] Video with MIME type application/octet-stream

Eric Carlson eric.carlson at apple.com
Wed Sep 1 09:10:07 PDT 2010


On Aug 31, 2010, at 4:01 PM, Ian Hickson wrote:

> On Tue, 31 Aug 2010, Eric Carlson wrote:
>> On Aug 31, 2010, at 12:36 AM, Ian Hickson wrote:
>>> 
>>> Safari does crazy things right now that we won't go into; for the 
>>> purposes of this discussion we'll assume Safari can change.
>> 
>> What crazy things does Safari do that it should not?
> 
> I forget the details, but IIRC one of the main problems was that it was 
> based on the URL's file extension exclusively.
> 
  No, I don't see how you came to that conclusion. 

  QuickTime knows how to create a movie from a text file (to make it easy to create captions, chapters, etc), but it also assumes a file served as "text/plain" may be coming from a misconfigured server. Therefore, when it gets a file served as "text/plain" it first looks at the file content and/or  the file extension to see if it is a movie file. It opens it as text only if it doesn't look like a movie.

  In your test page (http://hixie.ch/tests/adhoc/html/video/002.html), all four movies have correct extensions but are served as text/plain:

    <!DOCTYPE HTML>
    <title>text/plain video files</title>
    <p> <video autoplay controls src="resources/text.txt"></video>
    <p> <video autoplay controls src="resources/text.webm"></video> 
    <p> <video autoplay controls src="resources/text.m4v"></video>
    <p> <video autoplay controls src="resources/text.ogv"></video>

  When the shipping version of Safari opens this page the MPEG-4 file opens correctly, and opens the other three as "text" (if you wait long enough) because by default QuickTime doesn't know how to open the Ogg or WebM files. If you add QuickTime importers for WebM and Ogg, those file will be opened as movies instead of as "text" because of the file extensions, despite the fact that they are serve as text.

  FWIW, in nightly builds we are now configuring QuickTime so it won't ever open files it identifies as text.

eric





More information about the whatwg mailing list