The version of vichan running on lainchan.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.1KB

  1. /* This file is dedicated to the public domain; you may do as you wish with it. */
  2. if (window.addEventListener) window.addEventListener("load", function(e) {
  3. document.getElementById("playerheader").appendChild(settingsMenu);
  4. var video = document.getElementsByTagName("video")[0];
  5. var loopLinks = [document.getElementById("loop0"), document.getElementById("loop1")];
  6. function setupLoopLink(i) {
  7. loopLinks[i].addEventListener("click", function(e) {
  8. if (!e.shiftKey && !e.ctrlKey && !e.altKey && !e.metaKey) {
  9. video.loop = (i != 0);
  10. if (i != 0 && video.currentTime >= video.duration) {
  11. video.currentTime = 0;
  12. }
  13. loopLinks[i].style.fontWeight = "bold";
  14. loopLinks[1-i].style.fontWeight = "inherit";
  15. e.preventDefault();
  16. }
  17. }, false);
  18. }
  19. for (var i = 0; i < 2; i++) {
  20. setupLoopLink(i);
  21. }
  22. video.muted = (setting("videovolume") == 0);
  23. video.volume = setting("videovolume");
  24. video.play();
  25. }, false);