Created
June 6, 2011 13:58
-
-
Save lafeber/1010308 to your computer and use it in GitHub Desktop.
Revisions
-
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ /** Replaces video tag (src=[file].mp4) with flash for Firefox, Opera and IE <9 Make sure you have flowplayer! (www.flowplayer.org) width, height and src of the video should be set */ function replaceVideoWithFlash() { if(navigator.userAgent.indexOf('Firefox') != -1 || navigator.userAgent.indexOf('Opera') != -1 || ( navigator.userAgent.indexOf('MSIE') != -1 && parseFloat(navigator.appVersion.split("MSIE")[1]) < 9 )) { -
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ /** Replaces video tag (src=[file].mp4) with flash for Firefox, Opera and IE <9 Make sure you have flowplayer! (www.flowplayer.org) */ function replaceVideoWithFlash() { if(navigator.userAgent.indexOf('Firefox') != -1 || navigator.userAgent.indexOf('Opera') != -1 || ( navigator.userAgent.indexOf('MSIE') != -1 && parseFloat(navigator.appVersion.split("MSIE")[1]) < 9 )) { var videos = document.getElementsByTagName('video'); for(var i=0; i < videos.length ; i++) { var video = videos[i]; var src = video['src']; var width = video['width']; var height = video['height']; fvideodiv = document.createElement('div'); fvideodiv.innerHTML = '<object id="flowplayer_'+i+'" width="' + width + '" height="' + height + '" data="flowplayer-3.2.7.swf" type="application/x-shockwave-flash">' + '<param name="movie" value="flowplayer-3.2.7.swf" />' + '<param name="allowfullscreen" value="true" />' + '<param name="flashvars" value=\'config={"clip":"' + src + '"}\' />' + '</object>'; video.parentNode.insertBefore(fvideodiv, video); video.parentNode.removeChild(video); } } }