2014-03-20 00:04:23 +01:00
|
|
|
/* This file is dedicated to the public domain; you may do as you wish with it. */
|
2013-11-10 10:56:45 +01:00
|
|
|
if (window.addEventListener) window.addEventListener("load", function(e) {
|
2013-11-10 13:57:45 +01:00
|
|
|
document.getElementById("playerheader").appendChild(settingsMenu);
|
|
|
|
|
2013-11-09 10:11:22 +01:00
|
|
|
var video = document.getElementsByTagName("video")[0];
|
2013-11-10 13:57:45 +01:00
|
|
|
|
|
|
|
var loopLinks = [document.getElementById("loop0"), document.getElementById("loop1")];
|
|
|
|
function setupLoopLink(i) {
|
|
|
|
loopLinks[i].addEventListener("click", function(e) {
|
2013-11-11 06:34:03 +01:00
|
|
|
if (!e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
|
|
|
video.loop = (i != 0);
|
|
|
|
if (i != 0 && video.currentTime >= video.duration) {
|
|
|
|
video.currentTime = 0;
|
|
|
|
}
|
|
|
|
loopLinks[i].style.fontWeight = "bold";
|
|
|
|
loopLinks[1-i].style.fontWeight = "inherit";
|
|
|
|
e.preventDefault();
|
2013-11-10 13:57:45 +01:00
|
|
|
}
|
|
|
|
}, false);
|
|
|
|
}
|
|
|
|
for (var i = 0; i < 2; i++) {
|
|
|
|
setupLoopLink(i);
|
|
|
|
}
|
|
|
|
|
2014-03-05 01:45:53 +01:00
|
|
|
video.muted = (setting("videovolume") == 0);
|
|
|
|
video.volume = setting("videovolume");
|
2013-11-09 10:11:22 +01:00
|
|
|
video.play();
|
2013-11-10 10:56:45 +01:00
|
|
|
}, false);
|