OP is using AI for gaze detection, so when they look away it pauses videos, via a browser extension
I suppose one could also use tab / window focus to achieve the same, but depends on the UX you are after. I sometimes have youtube in the background because I am listening and not watching (podcasts / music)