1
0

Store autoplay state in localStorage.

This commit is contained in:
Alexander Andreev 2024-12-10 22:23:07 +04:00
parent e34e8dddb9
commit 4d40896376
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34

View File

@ -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)