How to pause a course video when the browser tab looses focus?

ac1918
Community Participant

Does anyone know of a way to force videos to pause when the student steps away, opens a new application or browser tab/window, etc.? We tried using Javascript to accomplish this but have not been successful with auto-triggering the pause.

Thoughts or recommendations would be greatly appreciated!