I discover that command
xset dpms 300 which turn off the screen for example after 5 minutes (300s), and it wonderfully doesn't turn off the screen if a youtube video is actually playing even in a background window.
However sometimes I want to keep a video playing on the background while not using the computer, so I can manually lock the computer with a custom script (I'm using i3) that will also turn off the screen (with
xset s activate).
However if a keyboard (or mouse) event happen the screen will turn on again and then never go back since the video..
Is it possible to have the timeout to be applied regardless of media context as long as the computer is locked?