How to Use Your Media Keys on Websites

Using your media keys should be simple: Just press them. For example, if you’re playing a YouTube video and it’s hidden in a background tab somewhere, you can press the Play/Pause key on your keyboard to pause it and press the key again to resume it. It’s that simple.

If you’re listening to a playlist on a music-streaming website like Spotify, the Next and Previous keys will likely skip back and forward in the playlist, just as they would in a desktop music application like iTunes.

Sure, this advice may seem simple—but these keys have existed for decades, and they didn’t work on websites until very recently. Web users have been trained to ignore the media keys. It’s time to forget that and press these keys again.

This won’t work absolutely everywhere on the web. It may not work on some websites. In some cases, your keyboard shortcuts may be controlled by a desktop media player that you have open. For example, if you’re running iTunes on your system and have an iTunes window open, the keys may control playback in iTunes rather than your web browser.

However, in general, on modern systems—-Windows 10, macOS, Chrome OS, and even Linux—media keys will just work.

When Did Browsers Start Supporting These Keys?

This feature has been around for a while in browsers like Apple Safari and Google Chrome. However, with the release of Firefox 81 in September 2020, support for media keys became universal among modern browsers:

Google Chrome gained support for media keys back in Chrome 73, released on March 12, 2019. Mozilla Firefox added support for media keys with Firefox 81, released on September 22, 2020. (Firefox had supported this feature since Firefox 71, but it was disabled by default. It became enabled by default with Firefox 81. ) Apple Safari on Mac gained media key support with the release of macOS High Sierra back on September 25, 2017. Microsoft Edge gained support for media keys when it switched to the Chromium code that forms the basis of Google Chrome. Microsoft released the new version of Edge on January 15, 2020. Any other browser based on Chromium—for example, browsers like Brave—will have support for media keys as long as they’re built on Chromium 73 or later.

How to Troubleshoot Media Keys in Web Browsers

If media keys don’t work to control your web browser, try closing any other media applications running on your system. This includes music players like iTunes and video players like VLC. The media keys can only control one media player at a time, and which playback application gets to control the keys is determined by your operating system.

If your media keys don’t work on a particular website, it’s likely that the website doesn’t support them. Technically speaking, website developers must use the MediaSession API to enable this feature on their websites. This feature lets websites take advantage of Chrome’s global media playback controls on its browser toolbar, too.

How to Disable Media Keys in Web Browsers

If you don’t like this feature and wish Chrome, Safari, Firefox, or Edge would just leave your media keys alone, you can still disable it.

In Google Chrome, Microsoft Edge, and other Chromium-based browsers, you can disable the “Hardware Media Key Handling” flag. In Mozilla Firefox, you can open the about:config advanced settings page and set the “media. hardwaremediakeys. enabled” option to “false”. In Apple Safari on a Mac, you’ll need a third-party application to prevent these keys from working in Safari. There are a variety of applications that reportedly work well, including Mac Media Key Forwarder and BeardedSpice, but we haven’t tried any of them.

Overall, however, these keys will “just work” automatically. If you’re not watching or listening to anything in your browser, your browser should get out of the way and let other applications use them.

However, if you plan on watching YouTube videos but you still want your keys to reliably control music playback in something like iTunes, you might need to disable the keys in your web browser.