I have the following code:
<video width="640" height="360" controls id="video-player" poster="/movies/poster.png"> <source src="/movies/640x360.m4v" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> <source src="/movies/640x360.ogv" type='video/ogg; codecs="theora, vorbis"'> </video>
For Firefox I looked at https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox where it refers to an 'error' event and an 'error' attribute. It seems the 'error' event is thrown pretty well straightaway and at that time there is no error attribute. Does anyone know how to diagnose the problem?
The HTML5 video format capabilities include three options to play: MP4, WebM, and Ogg.
The HTTP Content-Type for .ogg should be application/ogg (video/ogg for .ogv) and for .mp4 it should be video/mp4. You can check using the Web Sniffer.
Add these lines in your .htaccess file and it will work for all browsers. Works for me.
AddType video/ogg .ogv AddType video/mp4 .mp4 AddType video/webm .webm
If you dun have .htaccess file in your site then create new one :) its obvious i guess.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With