<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Legacy SWF Player with HTML5 fallback</title>
<script type="text/javascript" src="../js/swfobject.js"></script>
<script type="text/javascript">
//create query string object
var movieDetails = {};
decodeQuery();
function decodeQuery() {
var match,
pl = /\+/g,
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
while (match = search.exec(query))
movieDetails[decode(match[1])] = decode(match[2]);
}
//activate swf movie details
function swfPlay (){
var flashvars = {};
var params = {};
var attributes = {};
document.getElementById("swfMovie").style.display = "block";
swfobject.embedSWF("video/"+movieDetails.mFile+".swf", "swfMovie", movieDetails.mWidth, movieDetails.mHeight, "8.0.0", false, flashvars, params, attributes);
}
//activate alternative html5 content
function html5play (){
document.getElementById("html5").style.display = "block";
document.getElementById("3").height = movieDetails.mHeight;
document.getElementById("3").width = movieDetails.mWidth;
document.getElementById("mac").src = "video/"+movieDetails.mFile+".mp4";
document.getElementById("chrm").src = "video/"+movieDetails.mFile+".webm";
document.getElementById("fox").src = "video/"+movieDetails.mFile+".ogv";
}
</script>
</head>
<body>
<h1 id="Title">Template</h1>
<div align="center" class="movie">
<div id="swfMovie" style="display:none">
<h4>Videos on this page require Adobe Flash Player,<br><br>or an html5 enabled browser.</h4>
</div>
<div id="html5" style="display:none">
<video id="3" controls="controls">
<source id="mac" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source id="chrm" type='video/webm; codecs="vp8, vorbis"' />
<source id="fox" type='video/ogg; codecs="theora, vorbis"' />
<h4>Videos on this page require an html5 enabled browser,<br><br>or Adobe Flash Player.</h4>
</video>
</div>
</div>
<br><hr>
<script type="text/javascript">
//modify h1 header
document.getElementById("Title").innerHTML=movieDetails.mTitle;
//determine if Flash is loaded
if(swfobject.hasFlashPlayerVersion("1")){
swfPlay ();
}else{
html5play ()
}
</script>
</body>