loop controls on main page

This commit is contained in:
ccd0 2013-11-10 19:09:12 -08:00
parent bcdedcb28a
commit 9c335764c4
2 changed files with 29 additions and 3 deletions

View file

@ -7,10 +7,9 @@ if (window.addEventListener) window.addEventListener("load", function(e) {
function setupLoopLink(i) {
loopLinks[i].addEventListener("click", function(e) {
video.loop = (i != 0);
if (i == 1 && video.currentTime >= video.duration) {
if (i != 0 && video.currentTime >= video.duration) {
video.currentTime = 0;
}
video.play();
loopLinks[i].style.fontWeight = "bold";
loopLinks[1-i].style.fontWeight = "inherit";
e.preventDefault();