2013-11-10 04:56:45 -05:00
|
|
|
if (window.addEventListener) window.addEventListener("load", function(e) {
|
2013-11-10 07:57:45 -05:00
|
|
|
document.getElementById("playerheader").appendChild(settingsMenu);
|
|
|
|
|
2013-11-09 04:11:22 -05:00
|
|
|
var video = document.getElementsByTagName("video")[0];
|
2013-11-10 07:57:45 -05:00
|
|
|
|
|
|
|
var loopLinks = [document.getElementById("loop0"), document.getElementById("loop1")];
|
|
|
|
function setupLoopLink(i) {
|
|
|
|
loopLinks[i].addEventListener("click", function(e) {
|
|
|
|
video.loop = (i != 0);
|
2013-11-10 22:09:12 -05:00
|
|
|
if (i != 0 && video.currentTime >= video.duration) {
|
2013-11-10 07:57:45 -05:00
|
|
|
video.currentTime = 0;
|
|
|
|
}
|
|
|
|
loopLinks[i].style.fontWeight = "bold";
|
|
|
|
loopLinks[1-i].style.fontWeight = "inherit";
|
|
|
|
e.preventDefault();
|
|
|
|
}, false);
|
|
|
|
}
|
|
|
|
for (var i = 0; i < 2; i++) {
|
|
|
|
setupLoopLink(i);
|
|
|
|
}
|
|
|
|
|
2013-11-09 04:11:22 -05:00
|
|
|
video.muted = setting("videomuted");
|
|
|
|
video.play();
|
2013-11-10 04:56:45 -05:00
|
|
|
}, false);
|