Only pause video that has controls (and thus sound)
This commit is contained in:
parent
7361c71d2b
commit
fb592e192c
|
@ -104,8 +104,13 @@ function stopMediaPlayback() {
|
||||||
element.src = iframeSrc;
|
element.src = iframeSrc;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// We pause all videos that have controls. Video without controls shouldn't
|
||||||
|
// have sound and are actually converted gifs. Basically if the user can't
|
||||||
|
// start the video again, don't stop it.
|
||||||
document.querySelectorAll("video, audio").forEach(element => {
|
document.querySelectorAll("video, audio").forEach(element => {
|
||||||
|
if (element.hasAttribute("controls")) {
|
||||||
element.pause();
|
element.pause();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue