I just accidentally found a lame and hacky but working way to solve the issue - plug the headphones halfway, instead of fully, to the port :)
First, the bug has been around since 2001. Or earlier. It was reported as far back as that.
Reported: 2001-05-01 14:28 PDT
Mozilla Bug Report. Which tells you that not only is Mozilla aware of it, but they've known about it for a while. Oh, and I know that seems to be a more generic bug report, but this one here is more recent, and more specific to your issue, and is tagged as a duplicate of the first I linked you to.
That said, there is code to disable some (most?) Youtube keyboard shortcuts... but it must be added to the embedded tags when the video is put in the web page.
&:disablekb=1
There are numerous sites on the web passing that information out, here is just one. Unfortunately, I believe that if this was as simple as running a Greasemonkey script to add that code to any YouTUbe emedded video tags as you load the page, it would have been done already. By the people at Mozilla.
Now, I spent some time digging through the Addons at Firefox, and I came across this one called Stylish, which enables you to personalize your experience at sites like Youtube. I don't know personally, but depending on the level of customization, and exactly how it does what it does, you might be able to get it to inject the code.
There are Greasemonkey scripts that alter your Youtube experience like this one, but none detail the ability to disable keyboard shortcuts. However, either the author of the script didn't consider it, or it was never suggested to them.
Best Answer
try to go in chrome://flags (in the address bar) and change pause-background-tabs to disabled. I think it is working for me.