utubo / firefox-simple_gesture

🦊An add-on that adds simple touch gestures for Firfox for Android. Sorry, I only check issues sometimes.
https://addons.mozilla.org/ja/firefox/addon/simple-gesture/
Other
29 stars 1 forks source link

[Feature] Rewind / seek forward on youtube playback #60

Closed davidebaldini closed 4 years ago

davidebaldini commented 4 years ago

Hello @utubo, do you think it is possible to add a custom gesture to rewind or seek forward by a few seconds a Youtube video playing on the browser? This would be convenient to control very long videos where the sliding time-bar is too dense to be practical, such as in audiobooks.

I attached a USB keyboard to my phone to test if the left & right keys have any effect on the playback: they do work, but only on the desktop version of Youtube. This could be a possible solution if the add-on can simulate keystrokes.

But a better solution would be to stick to the mobile version of Youtube, and run some hypothetical JS to control the payback.

utubo commented 4 years ago

It is a good idea ! I added the code here. https://github.com/utubo/firefox-simple_gesture/wiki/Custom-gesture-examples#rewind--seek-forward-a-video

thank you.

davidebaldini commented 4 years ago

It works, nicely too.

I checked the MDN documentation on the new code snippets: currentTime and VIDEO are both standard identifiers and not specific to Youtube, so they should be robust against most changes on Youtube's pages. And of course they also work with videos hosted elsewhere outside of Youtube.