13

I am using mediaelement js.. on my .htacces I have these..

AddType video/mp4  mp4 m4v
AddType audio/mp4  m4a
AddType video/ogg  ogv
AddType audio/ogg  ogg oga
AddType video/webm webm

and on my index.html I have this on my <head>

<script src="/js/jquery.js"></script>
<script src="/js/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="/js/mediaelementplayer.css" />

and the code is

<video width="600" height="450" preload="none" autoplay preload="auto" >
    <!-- MP4 for Safari, IE9, iPhone, iPad, Android, and Windows Phone 7 -->
    <source type="video/mp4" src="videos/Sequence1.mp4"/>
    <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
    <source type="video/webm" src="videos/Sequence1.webm" />
    <!-- Ogg/Vorbis for older Firefox and Opera versions -->
   <source type="video/ogg" src="videos/Sequence1.ogv" />
    <!-- Flash fallback for non-HTML5 browsers without JavaScript -->
    <object width="320" height="240" type="application/x-shockwave-flash" data="flashmediaelement.swf">
        <param name="movie" value="flashmediaelement.swf" />
        <param name="flashvars" value="controls=&file=videos/Sequence1.mp4" />     
    </object>
</video>

unfortunately.. its not playing on mozilla browser.. it keeps on loading but not playing.. and using the ctrl+shift+k on mozilla.. I found these error.

-- [18:47:12.942] Specified "type" attribute of "video/mp4" is not supported. Load of media resource videos/Sequence1.mp4 failed. @ http://thesuperheroblueprint.com/

Please help me.. I really need to fix this so bad.. Here is the website..

markyeoj
  • 359
  • 2
  • 6
  • 17

2 Answers2

28

MP4 type isn't supported on Firefox! It's only supported in Safari 3.0+, Google Chrome 5.0+ and IE 9.0+! For Firefox you'll need .ogg file or .webm video files as sources! Here is an image containing all supported video formats in HTML 5: table displaying video formats supported by various browsers

And for audio support see this pic:

table displaying audio formats supported by various browsers

UPDATE:

Firefox now supports MP4 H.264 (AAC or MP3) https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats

Note: MP4s encoded with a high profile will not run on lower end hardware, such as low end Firefox OS phones.

Chalist
  • 3,160
  • 5
  • 39
  • 68
Brijesh Gajjar
  • 542
  • 5
  • 15
3

Firefox gives the error because it doesn't support video/mp4, it's nothing to worry about, something else is causing the problem. You could start by removing one of your two preload attributes although I don't think that's the main problem either.

If you load the webm video directly in Firefox it takes about 30 seconds and after it loads up the play point is right at the end of the video. If you load the ogv file directly it appears to play just fine. I would therefore conclude that there's something wrong with the encoding of your webm file, I'd try encoding it again with some different options.

As a side note, if you can't work out what's up with the encoding, there's really nothing in the video that requires it to be a video. It's basically a video of a slideshow, you might be better off implementing it that way, it would certainly reduce the bandwidth required.

robertc
  • 74,533
  • 18
  • 193
  • 177
  • 1
    thanks for the answer, looks like we have a different result when playing http://thesuperheroblueprint.com/videos/Sequence1.webm directly because at my end its playing just fine. but when I'm playing the video on the webpage. it takes 30 seconds and after that the point is right at the end of the vide. – markyeoj Jan 26 '13 at 14:33
  • Sorry, my mistake.. you are right I thought I am plying the webm video directly, it was the ogv video that playing fine. while the webm video is not playing.. – markyeoj Jan 26 '13 at 15:02
  • still no improvement si.. I am now very frustrated.. the html5 slides you suggested is not approved by my client. she just want me to fix the problem. What do you think? – markyeoj Jan 28 '13 at 11:57
  • @markyeoj I think there's still something wrong with the way you've encoded the WebM video – robertc Jan 28 '13 at 13:17
  • thanks, I appreciate that, do you have a suggestion what should i do? coz until I cant figure it out. – markyeoj Jan 28 '13 at 13:40
  • Do you think that there is a possibility that the miro video converter also caused the problem? – markyeoj Jan 28 '13 at 14:00