Not exactly sure I should document this, so I am creating this issue so people can find it in the future. Feel free to close this if/when it is documented elsewhere.

Problem:
On a project, MP4 videos loaded and played correctly on everything (IE6-8, Safari, Firefox, Chrome, iPad, iPhone) except IE9. IE9 showed the animated loading gif, but nothing else. I checked the IE9 Developer Tools network logs and noticed it said the file was 8kb. This video file is actually 30mb... I loaded the URL directly; the file downloaded correctly.

Cause:
The MIME type sent by the server was text/plain. It seems since IE9 "thought" the file was plain text, it transfered it in text mode ending the file transfer at the first EOF.

Solution:
Change the /etc/mime.types files to have an entry for mp4 files. It seems most servers already have this set, including my server; so I am surprised my client's server didn't have it.

System wide MIME types are set (for most Linux OSes) in /etc/mime.types. Here is what it should look like:

video/3gpp                                      3gp
video/dl                                        dl
video/dv                                        dif dv
video/fli                                       fli
video/gl                                        gl
video/mpeg                                      mpeg mpg mpe
video/mp4                                       mp4
video/ogg                                       ogv
video/quicktime                                 qt mov

MIME type defaults are set in the apache2.conf:

# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are# text.
# 
DefaultType text/plain

Comments

dave reid’s picture

Version: 7.x-1.1 » 7.x-1.x-dev

This is documented on http://mediaelementjs.com/ so I'm not sure where would be the best place to make sure we link to that.

knalstaaf’s picture

In case you have no access to /etc/mime.types, you can add this in the .htaccess file on the root of your website:

AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

(Source)

jnettik’s picture

Status: Active » Closed (works as designed)