Set overlay_autoplay to saved state. Also add a missing semicolon. :)
This commit is contained in:
parent
ebcc15dc7b
commit
0bc11dd5f2
@ -145,10 +145,12 @@ overlay_autoplay = document.getElementsByName("autoplay")[0];
|
|||||||
|
|
||||||
if (localStorage.getItem('autoplay') == null)
|
if (localStorage.getItem('autoplay') == null)
|
||||||
localStorage['autoplay'] = overlay_autoplay.checked = false;
|
localStorage['autoplay'] = overlay_autoplay.checked = false;
|
||||||
|
else
|
||||||
|
overlay_autoplay.checked = localStorage['autoplay'];
|
||||||
|
|
||||||
overlay_autoplay.addEventListener("change", e => {
|
overlay_autoplay.addEventListener("change", e => {
|
||||||
localStorage['autoplay'] = e.target.checked;
|
localStorage['autoplay'] = e.target.checked;
|
||||||
const media_element = overlay_content.firstChild
|
const media_element = overlay_content.firstChild;
|
||||||
if (e.target.checked && media_element !== undefined)
|
if (e.target.checked && media_element !== undefined)
|
||||||
if (media_element.tagName === "AUDIO" || media_element.tagName === "VIDEO")
|
if (media_element.tagName === "AUDIO" || media_element.tagName === "VIDEO")
|
||||||
if (media_element.ended)
|
if (media_element.ended)
|
||||||
|
Loading…
Reference in New Issue
Block a user