Html – Why would videojs HTML5 video not play sound in Firefox

htmloggvideo.jswebm

I've converted an .mp4 video into .ogg and .webm formats (with ffmpeg) and used videojs to create the following web page that plays the video on all browsers (IE6-IE9, safari, chrome, opera, firefox):

http://tanguay.info/examples/testvideo

However, Firefox (12.0) does not always play the audio, depending on how the page is accessed:

Playing from file:// with the webm source before ogg, Firefox plays fine:

<source src="videos/damconnect.mp4" type='video/mp4'>
<source src="videos/damconnect.webm" type='video/webm'>
<source src="videos/damconnect.ogg" type='video/ogg'>

But playing from file:// with the ogg source before webm, Firefox plays without audio:

And playing from http:// with either ogg or webm first, Firefox plays without audio.

How can I get Firefox to play via http:// with audio?


ADDENDUM:

Also: Opera will not play the video if ogg is listed first (just spins, doesn't start).

I notice that my tanguay.info server seems to be sending a text/plain header with the .webm video, how can I change that?

enter image description here


ANSWER:

I added this .htaccess file to the directory where index.htm is, which fixed the problem:

AddType audio/ogg oga ogg
AddType video/ogg ogv
AddType video/webm webm

Best Answer

For the text/plain - edit your mime.types file (~www/conf) and add webm/video webm

Chances are you are having the same problem with ogg/ogv, add mime type ogg/video ogg ogv

Also ensure the audio codec is correct on conversion.

EDIT

Ok, I see you added it to the httpd.conf - just read this

10.5.31. TypesConfig TypesConfig names the file which sets the default list of MIME type mappings (file name extensions to content types). The default TypesConfig file is /etc/mime.types. Instead of editing /etc/mime.types, the recommended way to add MIME type mappings is to use the AddType directive.

For more information about AddType, refer to Section 10.5.54 AddType.

Although I can find any argument as to why...

Related Topic