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?
This extension worked for me:
Global hotkeys for your favourite music players.
Control players inside Chrome from anywhere on your computer.
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.
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.
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:
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.
- Space Pause/Play
- Right Forward by 5 seconds*
- Left Rewind by 5 seconds*
- PgUp Forward by 1 minute*
- PgDn Rewind by 1 minute*
- Home Jump to the beginning.
- 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.
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.
If you refer to Chrome as browser, there is https://chrome.google.com/webstore/detail/key-socket-media-keys/fphfgdknbpakeedbaenojjdcdoajihik which even is open source https://github.com/borismus/keysocket.