I need to create a website which can be navigated, but after a period of inactivity,

I need to create a website which can be navigated, but after a period of inactivity, must loop a video replacing the web content. When a user is to move the mouse or click etc, I need the user to then be able to renavigate the website again.

I have the website test running OK, running from a single page using a function to switch display style of 'home' and 'smartfm' based on the click of the smart_fm_btn(). So between two divs, the website is running fine.

Because this runs from the same page, the inactivity also works really well, and launches the video after 5 seconds of nothing happening.

The issue I have is that I cannot reload the page and get back to the website from the video.

I can edit and use the following innerHTML element to get back to the website from video, but problem is I then can't navigate anywhere and get caught in an infinite loop of refreshing the goActive function.