HTML5 <video> tag for ogv file not work in Mozilla . Any better solution? -


there problem firefox. lot of questions there related didnt solution it. in link video tag's video not working in mozilla , in crome working fine. type='video/ogg' added no luck yet.

you use jquery check browser , load best format only...

i consider webm better firefox or chrome.. else, can use mp4.

just :

your html :

<video id="frog" loop autoplay ></video> 

your js :

    $(window).load(function(){        var is_firefox = navigator.useragent.tolowercase().indexof('firefox') > -1;        var is_chrome = navigator.useragent.tolowercase().indexof('chrome') > -1;        if(is_firefox || is_chrome){          // firefox or chrome, webm better            $("#frog").attr("src","http://www.ellevation.com.au/sanli/wp-content/uploads/2014/04/testvid_vp8.webm");        }else{            $("#frog").attr("src","http://www.ellevation.com.au/sanli/wp-content/uploads/2014/04/testvid_x264.mp4");        }     }); 

an example here.

edit : (september 2014)

it seems firefox no longer supports webm format on html5 video.

best solution seems :

html :

<video controls>     <source src="oggvideopath.ogv" type="video/ogg">     <source src="mp4videopath.mp4" type="video/mp4">     browser doesn't support <code>video</code>. </video> 

and best solution correctly encode mp4 ogg theora :

http://v2v.cc/~j/ffmpeg2theora/

very easy use, install , write command line : ffmpeg2theora mp4videopath.mp4


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -