7

I have the following HTML5 video code on my homepage and it acts strange in Firefox 11.

<video width="900" height="508" autoplay="autoplay" controls="controls">
    <source type="video/webm" src="http://www.mysite.com/MovieClip.webm"></source>
    <source type="video/mp4" src="http://www.mysite.com/MovieClip.mp4"></source>
</video>

When the homepage on my site loads, I see in the place of the video the following error message: "No video with supported format and MIME type found."

However, when I open up the media path "http://www.mysite.com/MovieClip.webm" directly, in a new tab, it loads the media just fine (using the internal Firefox HTML5 video player)!

Then, right afterwards when I go back to my homepage and refresh the page, it now loads the video just fine! Any ideas on why this is happening and how to fix?

Thanks in advance!

DecafJava
  • 479
  • 2
  • 7
  • 19

3 Answers3

3

Be certain that your web server is configured to deliver WebM video as MIME type "video/webm". You can quickly and manually check if this is the case by telnetting to your web server and issuing a HEAD request:

telnet www.mysite.com 80

[after connection...]

HEAD /MovieClip.webm HTTP/1.1
Host: www.mysite.com

And finish the request with 2 carriage returns. The HTTP response header should contain a "Content-Type:" line. If it doesn't say "video/webm", Firefox won't accept your WebM file.

Multimedia Mike
  • 12,660
  • 5
  • 46
  • 62
  • It does show it as video/webm. I also noticed that in the Firefox Net tab, the first time (when it has trouble loading it), it shows up as Content-Type: application/octet-stream, and then I also see another strange line called Working-Content-Type: video/webm. But once I open the video in another tab and then go back to the site and refresh it, it then works and shows the Content-Type as video/webm as expected. Strange! – DecafJava Mar 30 '12 at 03:07
  • I'd suggest flushing out your browser caches, shutting down the browser and trying again (though I suspect you have already tried this once or twice). – Multimedia Mike Mar 30 '12 at 04:52
  • What happens when you eliminate the MP4 source from the HTML text? I wonder if Firefox is getting confused by that. Also, what version of Firefox on which platform? – Multimedia Mike Mar 30 '12 at 16:32
  • Also, what web server is delivering this? And are you certain that the "Working-Content-Type:" header is delivered over the wire? Your comment about the Firefox Net tab (I'm not familiar with that facility) makes it sound like maybe Firefox injected that header. – Multimedia Mike Mar 31 '12 at 01:20
  • I tried eliminating the mp4 source and that didn't work. The Working-Content-Type (which I'm not even sure what it is) only gets shown whenever it is unable to load the video. Then, after I successfully open up the video source directly in the FF browser and then go back to the webpage and refresh it, it then no longer shows a Working-Content-Type and only shows the desired Content-Type: video/webm and the video loads just fine. The web server is IIS and the Net tab, by the way, is one of the Firebug tabs. – DecafJava Apr 01 '12 at 23:55
  • Thanks multimedia mike. Your content type thing helped me. I forced the server to serve the right thing by adding this: AddType application/x-shockwave-flash swf AddType video/mp4 mp4 AddType video/ogg ogg AddType video/webm webm To a .htaccess file in the video directory. The video (webm) directly called is working. But in the player i get "video loading stopped". Any idea? – func0der Apr 03 '12 at 16:51
  • Okay. Anyways. Restarting firefox helped me out. – func0der Apr 03 '12 at 17:00
2

Regardng to Multimedia Mikes answer. If your server delivers the wrong mime type to the videos just put a htaccess file with following content into your videos directory:

AddType video/mp4 mp4
AddType video/ogg ogg
AddType video/webm webm

This worked out well.

If, please rate his answer ;)

Greetings func0der

func0der
  • 2,192
  • 1
  • 19
  • 29
  • Can you post an url so i can check whether it works for me or other users? – func0der Apr 04 '12 at 12:27
  • Actually it is not on a publicly accessible URL yet. Also, a couple more clues. First of all, when I said Working Content Type, I meant Content-WorkType. Also, I noticed the status code returned on the MovieClip.webm to be a 206 Partial Content. Any ideas? – DecafJava Apr 04 '12 at 21:58
  • Yeah, when I point my FF browser to that specific file itself, it plays in the browser just fine. – DecafJava Apr 10 '12 at 22:27
  • No i mean on the site itself. Does it play in the videoplayer? Without u visiting: http://www.func0der.de/html5videotest/videos/video1.webm – func0der Apr 12 '12 at 16:21
  • Does my site work for you? Could you please provide an example link or something? – func0der Jan 28 '13 at 20:58
0

I am not entirely sure this will solve your problem, but we also have noticed erratic behavior with .webm movies in Firefox 11 (only on Windows): The video element's playhead automatically jumps to the end of the movie, even if you open the file explicitly, i.e. without a surrounding HTML page. This of course renders all autoplay settings unusable.

Our solution was to change the order of the sources, so that Firefox would prefer .ogg files over .webm - there was no need to change anything else in the HTML code.

weltraumpirat
  • 22,544
  • 5
  • 40
  • 54