Forum Discussion
SusanLythe-a3d2
7 months agoCommunity Member
Videos continue to play after navigating away from the window
I’ve uploaded a zip file to the company LMS and everything is working great, apart from one thing… if I navigate away from the window, it should pause videos playing - like it does with other zips I...
Nedim
7 months agoCommunity Member
Switch to the static video publishing setting. If the problem persists after making this change, try running the JavaScript code below using an 'Execute JavaScript' trigger when the timeline starts on this slide. Does it make any difference?
let video = document.querySelector('video');
document.addEventListener("visibilitychange", () => {
const { visibilityState } = document;
if (visibilityState === 'visible') {
video.play();
} else {
video.pause();
}
});