javascriptwindowsgoogle-chromevideoscreensaver

How to allow the Windows screensaver to start even if the current HTML page contains a video?


It is well known that, if a video is currently playing on a HTML page, the Windows screen saver won't start, and this is generally good (see How does YouTube prevent the screensaver from showing up during video playback? (Windows)).

But for our application in an embedded computer / Chrome is kiosk mode, we would like to allow the Windows screen saver to start even if the current HTML page in Chrome contains a playing video, even if it is something like:

<video id="abc"></video>
<script type="text/javascript">
navigator.mediaDevices.getUserMedia({ video: true }).then((stream) => {
    document.getElementById("abc").srcObject = stream; 
});
</script>    

How to enable the screensaver to start? (Or more precisely: how to disable the mechanism that makes that Chrome prevents the screensaver to start when there is a playing video?)


Solution

  • Disabling the screensaver behavior in a web browser is not something that can be controlled directly from a web page due to security and privacy considerations. Preventing the screensaver from starting is typically considered a browser-level feature, and modern web browsers often have built-in mechanisms to prevent the screensaver from activating during video playback for user convenience.

    In the case of Chrome, it automatically disables the screensaver while video is playing to provide a better user experience and prevent interruptions during video playback.

    If you're running Chrome in kiosk mode on an embedded computer and you want to allow the screensaver to start even when there's video playback, you may need to adjust the settings at the browser or operating system level rather than through the HTML page or JavaScript.