//html5 version of media wall

function writeHTML5Player(playerID,imageFile,width,height) {
if (width==null) {
width="640";
}

if (height==null) {
height="360";
}

$("#" + playerID).html('<video id="html5videoPlayer" controls="controls" poster="' + imageFile + '" style="width:'+width+'px; height:'+height+'px">your browser does not support the video tag</video>');
}
// load html5 version
function setNewVideo5(vpId, src) {
// get the video element
var videoPlayer = document.getElementById(vpId);
// set the source to the URL of the selected video from the array of video URLs
//videoPlayer.src = src;
$("#"+vpId).attr("src",src);
// load the video
videoPlayer.load();
// play the video

videoPlayer.play();
}
function stopVideo5(vpId) {
var videoPlayer = document.getElementById(vpId);
videoPlayer.pause();
}
$(document).ready(function(){
// setup the video player (for times when video is available)
$("#html5videoPlayer").bind('ended', function() {
//switchPrerollToMain('ended');
//startPlaying();
});
$("#html5videoPlayer").bind('error', function(err) {
//alert(startVideo + "\n" + this.error.code + "\n" + this.currentSrc);
// if the user has started playing video and there is an error (with the preroll), switch to the main video
//switchPrerollToMain('error');
});
$("#html5videoPlayer").bind('emptied', function() {
alert(event.type);
});
$("#html5videoPlayer").bind('canplay', function() {
alert(event.type);
});
$("#html5videoPlayer").bind('loadstart', function() {
alert(event.type);
});
$("#html5videoPlayer").bind('loadeddata', function() {
alert(event.type);
});
$("#html5videoPlayer").bind('play', function() {
//alert(event.type + "\n" + this.currentSrc);
});
})
