From fb592e192cbb60a53c2d8a5adfaa90bc5db93fd8 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 30 Oct 2020 19:16:15 -0500 Subject: [PATCH] Only pause video that has controls (and thus sound) --- Shared/Article Rendering/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Shared/Article Rendering/main.js b/Shared/Article Rendering/main.js index c3d7c8cab..413906197 100644 --- a/Shared/Article Rendering/main.js +++ b/Shared/Article Rendering/main.js @@ -104,8 +104,13 @@ function stopMediaPlayback() { 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 => { - element.pause(); + if (element.hasAttribute("controls")) { + element.pause(); + } }); }