For applications such as VLC I have global function keys I can map to, for example, pause my music/video even when I have a different program running.
Is there any way to get this functionality with YouTube?
Web Applications Stack Exchange is a question and answer site for power users of web applications. It only takes a minute to sign up.
Sign up to join this communityIf you use Chrome you can use the streamkeys extension.
I learned about this in this post: https://superuser.com/a/901979
I'd say not natively in YouTube (indeed the idea of a browser allowing a web page to install a machine-level keyboard hook gives me the fear).
However, I'd recommend using an OS-specific launcher (on Windows AutoHotKey ) and bind a key to switch to your browser, select a YouTube tab and Pause.
There is now also the chrome extension: https://chrome.google.com/webstore/detail/hotkeys-for-youtube-music/ggjkoecdjegahefiaibfnjgkebhijgpf
Be sure to reload the URL, or close and reopen the App (if you used "Install as App") for it