Is there any way to control Youtube through the media keys on the keyboard?

72

11

I have a nifty keyboard with media controls (play, stop, pause, forward and reverse). Is there any way to use them to control Youtube? That is, so that it pauses when I hit the pause key and moves back and forth between clips on the playlist with the forward and reverse keys?

Nathan Fellman

Posted 2010-01-25T09:15:14.007

Reputation: 8 152

just a side note: on a mac it simply works. – cregox – 2016-11-26T15:18:52.123

Update from 2019 - this is now built into Chrome: https://www.engadget.com/2019/03/12/chrome-73-media-key-support/

– CBarr – 2019-04-18T20:06:29.873

Answers

60

This extension worked for me:

Global hotkeys for your favourite music players.

Control players inside Chrome from anywhere on your computer.

Source Streamkeys

I am using it on Last.fm

Update: Google removed it from the store.

Update: Back in the google store.

More info and how to download: github.com/berrberr/streamkeys/issues/416

Here is a link to zipped extension: https://drive.google.com/file/d/1T4VdEpbUzZO_FNe7OCOEO1Ac8SEZceBn/view?usp=sharing

You can use load unpacked extension button on chrome://extensions page in developer mode to add.

Akira Yamamoto

Posted 2010-01-25T09:15:14.007

Reputation: 781

Not sure if it's a solution for you, but try http://www.streamkeys.com/guide.html The chrome app also has some settings, unfortunately none for the previous track, but everything else is there.

– None – 2015-10-09T08:46:31.713

I worked for me too for the multimedia keys of my Logitech. Just close and open again the youtube video. – Smeterlink – 2017-01-22T18:48:06.067

1Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change. – DavidPostill – 2017-10-07T20:23:46.867

2Looks like this extension was removed from the chrome extensions store. – Jon Dosmann – 2018-04-10T13:14:46.317

More info and how to download https://github.com/berrberr/streamkeys/issues/416

– Akira Yamamoto – 2018-04-13T00:53:13.633

3

The extension is back https://chrome.google.com/webstore/detail/streamkeys/ekpipjofdicppbepocohdlgenahaneen

– Coops – 2018-08-21T08:39:42.680

6

I find BearedSpice to be the great solution. It works for Safari and Chrome (probably other web browsers) as well as media players like Spotify and iTunes.

Fish Monitor

Posted 2010-01-25T09:15:14.007

Reputation: 355

Hmm, seems I can't use the existing media keys on my mac with this, and it doesn't come with keybindings by default. Feeling pretty uncreative. What did you end up using for keybindings? – adamlogan – 2016-02-23T07:07:37.783

I can use the media keys, but in Youtube and Safari, the next video cannot play automatically. – Fish Monitor – 2016-02-23T07:21:10.543

1

I was using Firefox and testing with Focus At Will. Just tested with Chrome and it works fine. I was able to bind fn + f7 f8 f9 which are the media keys, so that's good enough for me. I tend to use chrome anyways for music as I love the musixmatch and lyrics here addon extensions. happy camper :)

– adamlogan – 2016-02-23T07:40:39.430

It looks like a very well-made app, but it's just not working for me with Safari and YouTube. No idea why. Doesn't show YouTube as an option, only iTunes. – sudo – 2017-09-13T00:03:04.953

5

Chrome 73 does it out of box.

Some people may even want to disable it at chrome://flags/#hardware-media-key-handling (source).

Victor Sergienko

Posted 2010-01-25T09:15:14.007

Reputation: 536

4

For an answer that supports Firefox 57, since the add-on Media Keys which solves the problem in this post does not work in this version.

A full answer can be found here. I will only resume here the main points.

The problem arrives because Firefox 57 drops support for XUL add-ons, now called "Legacy", in favor of WebExtensions which are compatible with Google Chrome. This means that the vast majority of add-ons will become unusable.

The solutions I have listed in the above link are :

  • Ask the developers of the Media Keys add-on to make the effort of converting it to WebExtensions.

  • Firefox 57 will include a "find similar extension" tool which might help to find replacement add-ons.

  • Abandon Firefox in favor of Chrome.

  • Turn off updates and stay with Firefox 56 forever - not a real solution.

  • Switch to Firefox ESR which will continue in version 56 until June, 2018.

  • Switch to another fork of Firefox that keeps XUL add-ons:

  • Use Chrome extensions in Firefox 57. The Firefox add-on Chrome Store Foxified already allows this. The Chrome extension Streamkeys may fit the bill.

  • For the media keys that are not handled by the operating system, use AutoHotkey to map the media keys to Youtube key shortcuts.

harrymc

Posted 2010-01-25T09:15:14.007

Reputation: 306 093

Since this is still not fixed http://bugzilla.mozilla.org/show_bug.cgi?id=1411795 I am switching to http://github.com/henrypp/chromium which works great with Streamkeys as you said. Thanks for your answer but Mozilla really failed here

– Steven Penny – 2017-12-09T16:18:20.453

@StevenPenny: Chrom(ium) suffers from the same problems as Firefox 57+ does now : Lack of control for the extensions over the basic engine. For example, try to place the tabs below the address line, and much more. These insurmountable Chrom(ium) problems are a child's play in Waterfox. – harrymc – 2017-12-10T17:17:27.080

1

With a non-obvious trick, you can use keyboard keys without installing any extension or plugin. It doesn't do exactly what you asked for but works with all keyboards.

To initiate, click on the video progress bar once. Now the progress bar control has focus and following keystrokes work.

  1. Space Pause/Play
  2. Right Forward by 5 seconds*
  3. Left Rewind by 5 seconds*
  4. PgUp Forward by 1 minute*
  5. PgDn Rewind by 1 minute*
  6. Home Jump to the beginning.
  7. End Jump to the End (You see a pattern developing by now).

* (could be different based on video length; I've not tested a lot)

After initial click the focus is not obvious but as soon as you use any of the above keys then the "focus" is obvious because of change of the background color. See image here.

enter image description here There's more.. Once the focus is obvious on the progress bar Tab and Shift-Tab will move to other controls, i.e. [Play] [Jump to End] [Volume] [Volume Slider] [CC] and so on. Each control button will react to Space. [Jump to End] did not work for me. Someone at Youtube's 508 compliance missed it.

You can tab to the [Volume] button and use Up and Down keys to change the volume. While there Space will mute/un-mute.

If you Tab once more, it exposes the sometimes invisible [Volume] control. Here you can use Left and Right to change volume.

Finally, my favorite! You can jump to a percentage of the video i.e. Press

  • 1 - Jump to 10% of video.
  • 2 - Jump to 20% of video.
  • . etc.
  • . etc.
  • 9 - Jump to 90% of video.

These were most likely developed for 508-usability compliance but I find them very convenient and hope others do too.

LMSingh

Posted 2010-01-25T09:15:14.007

Reputation: 807

3This does not work if you change tabs – Steven Penny – 2017-10-09T21:00:07.153

@StevenPenny that is normal behavior. Because the progress bar no longer will get the keystrokes. The keystrokes now obviously need to go to the newly focused tab. BTW, if you switch back to the tab, at least in my tests, the keystrokes continue to work the same way. Keep in mind as I mentioned at the beginning, this is not exactly what the original author asked. I'm simply providing something, others might find useful. – LMSingh – 2017-10-10T01:51:06.427

1It is because of this answer, I won't be able to say that this is a shopping recommendation question.... Even though it does not answer the OP question directly, this hack could be used by anyone with a normal keyboard. +1 for that! – Prasanna – 2017-10-10T06:52:39.400

1One more useful control : < and > move backwards and forwards in time by one frame, respectively. – OceanBagel – 2018-07-16T20:31:03.987

0

bk138

Posted 2010-01-25T09:15:14.007

Reputation: 109

Warning: not actively maintained, looking for new owner – Akira Yamamoto – 2017-10-27T00:59:39.740

It seems to be maintained now. It works perfectly on youtube. – Doezer – 2018-05-20T17:41:45.843