YouTube’s play/pause keyboard shortcut doesn’t work all that great. If you’re wondering why you’ve never heard of said shortcut it’s mostly because it doesn’t work. You may have hit the shortcut multiple times and never realized it wasn’t working. The shortcut is the space bar and nine out of ten times it will just scroll down on the page instead of pausing the video. With the shortcut rarely working, it’s inconvenient to pause a video on YouTube before you switch to a different tab. What I normally do is hit the hard mute key on my keyboard to stop all sound if I need to mute it in a hurry. Smart Pause for YouTube is a Firefox extension that will automatically pause a YouTube video when you switch to a different tab, and automatically play it when you return to it.
Install the add-on and forget it’s there. It works silently in the background and the play/pause transition is just seamless.
The add-on works flawlessly but there is room for improvement. For one, if you actually pause a video before you switch to a different tab, it will begin playing again automatically when you switch back to it without you clicking play. This may or may not be a good thing and there should be a setting that lets you choose if the add-on will override manual play/pause.
The add-on does not work for embedded YouTube videos so if you’ve played one and you navigate away from the page the video will continue to play.