Copy link to clipboard
Copied
Hi,
I`m using Captivate 9 and I publish in HTML5.
Is there a way to automatically pause a project if the user changes over to another browser window? And to resume the project if the user changes back to the original window (in which the course is running)?
Maybe some JavaScript solution?
Thank you very much for any help!
Best regards
Michael
Add this in the head of the index.html
<script>
function chkVisibilityChange()
{
if ( document.hidden )
{
window.cpCmndPause = 1;
}
else
{
window.cpCmndResume = 1;
}
}
document.addEventListener("visibilitychange", chkVisibilityChange, false);
</script>
Copy link to clipboard
Copied
Add this in the head of the index.html
<script>
function chkVisibilityChange()
{
if ( document.hidden )
{
window.cpCmndPause = 1;
}
else
{
window.cpCmndResume = 1;
}
}
document.addEventListener("visibilitychange", chkVisibilityChange, false);
</script>
Copy link to clipboard
Copied
Great answer! Thank you very much, this is exactly what I was looking for!
Copy link to clipboard
Copied
Good morning and thanks for your support. I have a little problem, I try to synthesize.
My client wants to avoid user open new window/program while he's watching the course.
I have tried this code and it works perfectly only if I open new browser window.
If I open new program (Teams, Outlook.. or a pdf) the course continues to run.
Could you please tell me how to fix this?
Thank you in advance.