Browse Source

treat controls as links when clicked with modifier keys

pull/40/head
ccd0 11 years ago
parent
commit
5fbd7a6a95
  1. 14
      playersettings.js

14
playersettings.js

@ -6,13 +6,15 @@ if (window.addEventListener) window.addEventListener("load", function(e) {
var loopLinks = [document.getElementById("loop0"), document.getElementById("loop1")];
function setupLoopLink(i) {
loopLinks[i].addEventListener("click", function(e) {
video.loop = (i != 0);
if (i != 0 && video.currentTime >= video.duration) {
video.currentTime = 0;
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();
}
loopLinks[i].style.fontWeight = "bold";
loopLinks[1-i].style.fontWeight = "inherit";
e.preventDefault();
}, false);
}
for (var i = 0; i < 2; i++) {

Loading…
Cancel
Save