Maybe it depends on the browser and the operating system, but I can tell you that using Firefox 32.0.1 in Windows 7 64-bit, whenever a sound is played by the Flash plugin, it prevents the display from turning off. This can be seen by running
powercfg -requests while a sound is playing (run
cmd.exe as an administrator before typing the command):
[PROCESS] \Device\HarddiskVolume1\Program Files (x86)\Mozilla Firefox\firefox.exe
[DRIVER] IDT High Definition Audio CODEC (HDAUDIO\FUNC_01&VEN_111D&DEV_76DF&SUBSYS_1028053F&REV_1002\4&313bea4d&0&0001)
An audio stream is currently in use.
Two things are shown in this example output. It's the firefox.exe process under
DISPLAY: that is preventing the display from turning off. The sound playing through the audio driver prevents the system from going to sleep.
I consider Firefox's behavior undesirable, as I seldom watch long YouTube videos, and I don't want every message notification from Facebook Chat to turn my screen on. The behavior can be changed by using a
powercfg -REQUESTSOVERRIDE command, like this:
powercfg -REQUESTSOVERRIDE process "\Device\HarddiskVolume1\Program Files (x86)\Mozilla Firefox\firefox.exe" display
powercfg /? for help.