How can I keep video playing in the background?

Question:
[Clearly ask your question.]

How do I keep videos playing in the background when users move away from the tab?

Product:
[Which editor or feature is your question most relevant to? e.g. Wix Editor, Wix Studio Editor, Editor X.]

Velo javascript

What are you trying to achieve:
[Explain the details of what you are trying to achieve. The more details you provide, the easier it is to understand what you need.]

I have setup interactive videos as a part of an online course. However, there are timing errors when people open & browse other tabs, even if they leave for a few seconds. How do I keep the videos working in the background, so that there are no interruptions/timing problems.

What have you already tried:
[Share resources, forum topics, articles, or tutorials you’ve already used to try and answer your question.]

Additional information:
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]

Once the user leaves the page, site, or tab. you can simulate the running/playing time of your VIDEO.

  1. Getting the right point for start of playbacksimulation…
    something like element.onLeave(), window.onClose(), onViePortLeave() or enter().
    You have now defined the exact point when the simulated playback starts to count/play,
    saving the leaving time somethere (for example → 20:15:33) → TIMESTAMP of leaving.

  2. Once you come back to that page → reading out the last saved → TIMESTAMP ← , comparing it with the current time, to make the calculations and setting the video to that point and play it automatically.

This is just a simple brainstorming. You will surely have to do some more coding.