This add-on is actually being recommended as a solution to this problem at support.mozilla.org (see https://support.mozilla.org/en-US/kb/some-videos-wont-play-background).
As an example, an extension can listen for and intercept visibilitychange and fullscreenchange events so a website will not be able to react to a tab being hidden.
Please visit Video Background Play Fix to see or install an example of such an extension.
This has been enabled in Nightly.
However it times out after some time on YouTube, likely due to https://github.com/mozilla-mobile/fenix/issues/9691
Closing as add-on is available in Nighty and Beta and will roll out to next release.
Most helpful comment
This add-on is actually being recommended as a solution to this problem at support.mozilla.org (see https://support.mozilla.org/en-US/kb/some-videos-wont-play-background).