Videos continue to play after navigating away from the window

Apr 19, 2024

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’ve uploaded, but it doesn’t.

I’m thinking the issue might be down to the Slide Properties or Triggers, so here’s what I’ve set in the .story file:

  1. Player Style=Modern and Play Video=Automatic
  2. Player Options (When Revisiting) is set to "Resume on Restart".
  3. I’ve set True/False variables set to False on specific slides to track completion from a Main Menu slide. Then, on the Main Menu I’ve added triggers which set the state of those specific slides to completed state when timeline starts on any of those slides if value = True.
  4. Also, the Slide Properties “When Revising” option is set to a mix of the 3 options throughout the entire file, as some need to “Reset” if returned, whereas others need to “Resume” to where they left off; and some remain as “Automatic”.  

Like I say, everything is working perfectly fine, except when moving away from the window.  Anyone any ideas?

12 Replies
Susan Lythe

To add to the above, I've been testing on a different .story file which has a mix of the 3 Slide Properties (Resume, Reset, Auto) and pauses if moved away from the LMS window it's playing within.  So as a test, I changed 4 Slide Properties and uploaded into LMS and now it doesn't pause.  I've even reset the 4 Slide Properties I changed and it still doesn't pause.  My conclusion here is there is a bug... unless anyone can help.

Susan Lythe

Hi Nedim, yes video continues when switching to another browser or window.  

I've repeated the same test a few times now on a copy of a .story file that was working, by changing 11 slides from Resume Saved State to Automatically Decide; then Saved, then uploaded to LMS - it failed and continued playing the video when I switched windows.  So then I changed the same 11 slides from Automatically Decide back to Resume Saved State, and Saved, then uploaded to LMS.  It failed again.

Susan Lythe

I've been doing tonnes of testing and have success.  Basically, I have 2 laptops... one has had the recent Storyline updates applied and the other hasn't.  The one that has had the updates, is the one that is causing the problem, and the one that hasn't had the updates works perfectly fine and pauses the videos if moved away from the window.

Nedim Ramic

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();
  }
});