summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2014-04-06 21:39:33 +0200
committerczaks <marcin@6irc.net>2014-04-06 21:39:33 +0200
commit97792ff38732274e906071e72902db3b83df9f61 (patch)
tree32095682b0bafbb326a8cad6b03390b8b238eb5e /js
parente99c638e260a4e3f883a16c7e53b41cbfb542691 (diff)
more work on containerchan
Diffstat (limited to 'js')
-rw-r--r--js/expand-video.js2
-rw-r--r--js/webm/playersettings.js28
2 files changed, 29 insertions, 1 deletions
diff --git a/js/expand-video.js b/js/expand-video.js
index 27438427..96427667 100644
--- a/js/expand-video.js
+++ b/js/expand-video.js
@@ -41,7 +41,7 @@ function setupVideo(thumb, url) {
video.innerText = "Your browser does not support HTML5 video.";
videoHide = document.createElement("img");
- videoHide.src = configRoot + "cc/collapse.gif";
+ videoHide.src = configRoot + "static/collapse.gif";
videoHide.alt = "[ - ]";
videoHide.title = "Collapse video";
videoHide.style.marginLeft = "-15px";
diff --git a/js/webm/playersettings.js b/js/webm/playersettings.js
new file mode 100644
index 00000000..861d27c2
--- /dev/null
+++ b/js/webm/playersettings.js
@@ -0,0 +1,28 @@
+/* This file is dedicated to the public domain; you may do as you wish with it. */
+if (window.addEventListener) window.addEventListener("load", function(e) {
+ document.getElementById("playerheader").appendChild(settingsMenu);
+
+ var video = document.getElementsByTagName("video")[0];
+
+ var loopLinks = [document.getElementById("loop0"), document.getElementById("loop1")];
+ function setupLoopLink(i) {
+ loopLinks[i].addEventListener("click", function(e) {
+ 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();
+ }
+ }, false);
+ }
+ for (var i = 0; i < 2; i++) {
+ setupLoopLink(i);
+ }
+
+ video.muted = (setting("videovolume") == 0);
+ video.volume = setting("videovolume");
+ video.play();
+}, false);