diff --git a/web/assets/js/main.js b/web/assets/js/main.js index 53fb423..ce0b332 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -57,7 +57,11 @@ overlay_content.addEventListener("mousemove", e => { overlay_autoplay = document.getElementsByName("autoplay")[0]; +if (localStorage.getItem('autoplay') == null) + localStorage['autoplay'] = overlay_autoplay.checked = false; + overlay_autoplay.addEventListener("change", e => { + localStorage['autoplay'] = e.target.checked; if (e.target.checked && overlay_content.firstChild !== undefined) if (overlay_content.firstChild.tagName === "AUDIO" || overlay_content.firstChild.tagName === "VIDEO") if (overlay_content.firstChild.ended)