Store autoplay state in localStorage.
This commit is contained in:
parent
e34e8dddb9
commit
4d40896376
@ -57,7 +57,11 @@ overlay_content.addEventListener("mousemove", e => {
|
|||||||
|
|
||||||
overlay_autoplay = document.getElementsByName("autoplay")[0];
|
overlay_autoplay = document.getElementsByName("autoplay")[0];
|
||||||
|
|
||||||
|
if (localStorage.getItem('autoplay') == null)
|
||||||
|
localStorage['autoplay'] = overlay_autoplay.checked = false;
|
||||||
|
|
||||||
overlay_autoplay.addEventListener("change", e => {
|
overlay_autoplay.addEventListener("change", e => {
|
||||||
|
localStorage['autoplay'] = e.target.checked;
|
||||||
if (e.target.checked && overlay_content.firstChild !== undefined)
|
if (e.target.checked && overlay_content.firstChild !== undefined)
|
||||||
if (overlay_content.firstChild.tagName === "AUDIO" || overlay_content.firstChild.tagName === "VIDEO")
|
if (overlay_content.firstChild.tagName === "AUDIO" || overlay_content.firstChild.tagName === "VIDEO")
|
||||||
if (overlay_content.firstChild.ended)
|
if (overlay_content.firstChild.ended)
|
||||||
|
Loading…
Reference in New Issue
Block a user