Automatically inhibit screensaver when video playing

It used to be that watching a (eg. Youtube) video in a browser (Firefox, Chromium) would prevent the screensaver from activating. However, for the past several months the screensaver activates after some time while playing a video, as though the system were idle.

Where is this automatic ‘inhibit’ behavior defined and how can it be restored to the desirable previous behavior? There has been no change in the Screensaver preferences, idle time, etc.

MATE 1.28.2, Fedora 39 and 40, several recent versions of Firefox and Chromium.

Perhaps systemd-inhibit.

systemd-inhibit may be used to execute a program with a shutdown, sleep,
or idle inhibitor lock taken.

How would that help? It does not make sense to launch a browser with systemd-inhibit generally.

Can anyone confirm whether video playback inhibits screensaver activation or whether screensaver activates during playback? What is the expected behavior?