When watching a YouTube video in Firefox, you may want to switch to another tab in your Web browser to research something you just saw or heard, or maybe to a word processing application to take notes. If keeping your eyes on the video isn't a priority, then you don't need to worry about finding the pause button before doing either of these things. However, if you want to pause, there's a browser extension called YouTube Smart Pause that can do it for you automatically.
YouTube Smart Pause offers options to pause YouTube videos when you leave the tab, or when Chrome becomes your inactive window. Fortunately, all you need to do is install a copy of YouTube Smart Pause for Firefox and it'll start working right away. If you want to configure it, the easiest way is through the add-on menu, where you can press the Options button near YouTube Smart Pause.
Installing this add-on doesn't mean that you have to permanently pause every single video when you make the YouTube tab inactive. In fact, there's a quick keyboard shortcut that lets you flip it on and off: Ctrl + Alt + Y on Windows, or Command + Option + Y for OS X. The add-on can also be disabled through the right-click context menu when a video is playing.
Overall, this add-on is especially useful to people doing research or taking notes from a class video. Though I bet once I get used to the videos automatically pausing, I'm going to be really confused when using someone else's computer as to why the video is still playing.
There doesn't seem to be an identical extension for Google Chrome, but hopefully one is in the works by someone...somewhere.