1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-17 19:29:28 +01:00

Loop videos by default WebM option

This commit is contained in:
8chan 2015-02-21 04:49:45 -08:00
parent ae02998948
commit 1258d793c0
3 changed files with 6 additions and 3 deletions

View File

@ -13,7 +13,7 @@ function setupVideo(thumb, url) {
var videoContainer, videoHide;
var expanded = false;
var hovering = false;
var loop = true;
var loop = setting("videoloop");
var loopControls = [document.createElement("span"), document.createElement("span")];
var fileInfo = thumb.parentNode.querySelector(".fileinfo");
var mouseDown = false;
@ -192,7 +192,7 @@ function setupVideo(thumb, url) {
loopControls[0].textContent = _("[play once]");
loopControls[1].textContent = _("[loop]");
loopControls[1].style.fontWeight = "bold";
loopControls[(setting("videoloop") ? 1 : 0)].style.fontWeight = "bold";
for (var i = 0; i < 2; i++) {
setupLoopControl(i);
loopControls[i].style.whiteSpace = "nowrap";

View File

@ -8,7 +8,8 @@ if (typeof _ == 'undefined') {
var defaultSettings = {
"videoexpand": true,
"videohover": false,
"videovolume": 1.0
"videovolume": 1.0,
"videoloop": true
};
// Non-persistent settings for when localStorage is absent/disabled
@ -53,6 +54,7 @@ settingsMenu.innerHTML = prefix
+ '<div style="'+style+'">'
+ '<label><input type="checkbox" name="videoexpand">'+_('Expand videos inline')+'</label><br>'
+ '<label><input type="checkbox" name="videohover">'+_('Play videos on hover')+'</label><br>'
+ '<label><input type="checkbox" name="videoloop">'+_('Loop videos by default')+'</label><br>'
+ '<label><input type="range" name="videovolume" min="0" max="1" step="0.01" style="width: 4em; height: 1ex; vertical-align: middle; margin: 0px;">'+_('Default volume')+'</label><br>'
+ suffix;

View File

@ -24,5 +24,6 @@ if (window.addEventListener) window.addEventListener("load", function(e) {
video.muted = (setting("videovolume") == 0);
video.volume = setting("videovolume");
video.loop = (setting("videoloop") == 1)
video.play();
}, false);