HTML5 video won’t play in Firefox

What the…?  I added the .ogv video file, why isn’t it playing in Firefox!?

I don’t know about you, but I don’t exactly love having to convert videos and provide 3 file formats for every video I need to self host.  You could always just use an MP4 with a Flash video player that falls back to HTML5 on iOS, but I mean that just isn’t hip, you know? So we bite the bullet and convert the MP4 into a WebM and Theora format.  However, I did that recently and noticed that the Theora (.ogv) file didn’t want to play in Firefox. Which is strange because that browser is the whole reason we have to include that file format.

Turns out that it was a MIME type issue.  My web server was responding with a content-type of text/plain instead of video/ogg.  If you’re on an Apache server then you can add the following to your .htaccess file to fix it:

AddType video/ogg .ogv

Or just to be on the safe side, add all three:

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

Badda bing, badda boom.

Feel free to add your comment..

Your email address will not be published.