This is a metabug for tracking all media wakelock related issues.
When audio is playing no matter its tab is on foreground/background, Firefox would request a wakelock prevent computer going to sleep.
When video is playing and its tab is on foreground, Firefox would request a wakelock prevent screen going off.
[How to check wakelock]
pmset -g assertions
adb shell dumpsys power
Linux (ubuntu): https://askubuntu.com/questions/1071514/how-to-find-a-program-which-is-preventing-sleeping