HTML5 Video works locally, but not on the server

2011.11.10 | Web Development | , , , ,

Problem:

HTML5 Video plays correctly on your local copy of a site you’re building, but once you upload it to a server, it breaks.

Solution:

This can happen if the server sends the video back with the wrong MIME-Type, usually text/plain or something similar. What you need to have the server send the correct MIME-Type. If you’re using Apache, add these lines to your .htaccess or server configuration file:

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

  • Umer

    Thanks