3
votes

I have coded webm videos with Miro Video Converter and also with FreeMakeVideo Converter with the same result: some webm videos play in Firefox while others won't when embedded with the html5 video tag.

In Chrome they ALL play correctly.

In my Apache configuration I have added: AddType video/webm .webm

I have also added a .htaccess file with the same: AddType video/webm .webm

Doesn't make any difference. Some of the webm files play fine, while others don't play at all.

If I open the webm files straight in Firefox they ALL work fine, but in the video tag only some of them work.

Any ideas?????

2
Did you use any different settings for the different videos? For example, a different bitrate, audio format, size?Martin Atkins
Can you make one of the problem videos available for study?Multimedia Mike

2 Answers

3
votes

I know this question is old but I actually just had this problem the other day and I figure I'd answer it for any future adventurer who encounters the same issue.

This is a known issue in Firefox. Sometimes, it just doesn't want to play webm files. I don't know why, I didn't bother to figure it out. I was able to figure it out by switching the order of my source tags.

I used to have it like this:

<source src="myVideo.webm" type="video/webm">
<source src="myVideo.mp4" type="video/mp4">
<source src="myVideo.ogv" type="video/ogv">

This way, firefox came it, saw webm first and chose to try and opne that. Some issue was causing it to not be able to play but, since it supports that format, it used that source anyway. To fix this I did the following:

<source src="myVideo.ogv" type="video/ogv">
<source src="myVideo.mp4" type="video/mp4">
<source src="myVideo.webm" type="video/webm">

This way when firefox reads the sources, it sees the ogv file first and chooses to open it since it can support it. Haven't had an issue since.

Hope this helps someone...

0
votes

I'll add my 2¢ here too. Having just experienced this problem today myself. With Firefox now at version 33 (!), Firefox does "something" with webm, but it certainly doesn't do the RIGHT thing. (I started a thread about it here...Trouble getting HTML5 vidio to play, in Firefox 33

But the bottom line is that this is another case of a Firefox problem that will probably take years to solve. But I digress... it IS a Firefox problem, and since the preferred order for listing video source files is MP4, followed by webm and then ogg, the only sensible thing to do for now is detect the firefox browser, and act accordingly. The way I did this was to create a javascript function in my common "sitescripts.js file like this...

function browserComment(browser, comment)
 {
  if(navigator.userAgent.toLowerCase().indexOf(browser) < 0) return;

  if (comment == true)  document.write("<!--");
  else  document.write("-->");

 }

Its purpose is to allow me to detect a particular browser, and either add an HTML comment start, or a comment end. So next, in my HTML5 video coding, I'll do something like the below. Note how I use the function above to detect firefox, and add an open or close comment as the page is rendered, by passing either true or false.

<video width="640" height ="480" controls poster="somePhoto.JPG">

  <source src ="someVideo.mp4" type='video/mp4' > <!--cSafari / iOS 1st -->

  <!-- firefox supports 'webm'... but doesn't work properly. 
   So I'll comment out the webm version -->

  <script> browserComment('firefox', true ) </script>
  <source src ="someVideo.webm" type='video/webm' > <!-- Firefox / Opera / Chrome -->
  <script> browserComment('firefox', false ) </script>

  <source src ="someVideo" type='video/ogg' > <!-- Firefox / Opera / Chrome -->

  <!-- other code to invoke Flask player as a fallback -->

 </video>

Its a little ugly, but at least it preserves the proper order of video sources for other browsers that work fine with the webm files, like Chrome. When Mozilla finally fixes the problem, maybe around version 623.2 in a galaxy far far away, I'll only have to alter my browserComment() function, to start taking the version into account.