(function () { const TIMEOUT_MS = 5 * 60 * 1000; let timer; function reset() { clearTimeout(timer); timer = setTimeout(() => { window.location.href = '/video'; }, TIMEOUT_MS); } ['mousemove', 'mousedown', 'keydown', 'touchstart', 'scroll', 'pointerdown'] .forEach(evt => document.addEventListener(evt, reset, { passive: true })); reset(); // start the clock on page load })();