-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headphone remote control - enable next
and previous
navigation option on Android
#847
Comments
What do you expect to happen when you use a next/prev action? |
Depends on the content / personal preferences. Music / audio books with multiple files:
Files with chapters (audio books, podcasts):
However, there are some minor tweaks I would love to see in the settings, although they would take a lot of effort to implement:
For play/pause i would like to see an increasing amount of rewind seconds, that resets after 3 seconds of no action, example:
Same of course applies to step back and step forward on the player and lockscreen controls. You could also increase that to 2 times per time step (increase timer after 2 rounds of rewinding). I think in most cases you pause multiple times you want to rewind the book just a few seconds, because you missed something. But the more you do it the more you want to go back. So possible settings could be:
|
Just weighing in on how I use headphone buttons: I'd never want my headphone buttons to do next or previous track/chapter. That's way too long in an audio book, and way too easy to mess up with no way to get back to where you just were. The only button I would personally use from my headphones is a short rewind 30-60s. When I'm out running or walking, sometimes I need to skip back because I got distracted and missed something. |
Ok, I played around with the click handler in a fork and think I found a pretty neat solution for the click detection. Unfortunately I'm not a kotlin native and can't get it translate to the player actions - so I could use some help. So here is the diff: how does this work:
problems:
missing things:
@advplyr |
@advplyr
whereas the second column is a select box with the following options:
Additionally, the click-timeout could be a setting:
Since some of the actions would need additional implementation steps, the items below the |
@advplyr I think this would be a GREAT addition to Audiobookshelf, maybe we should start with a configuration less default setting (like described above). I think the most important part missing is the fastForward, rewind, next, previous steps in the player notification service. |
UPDATE: Setting Using a headset now uses the following experimental click-codes by default:
I would love to get some feedback on this. Fastest way to check it out is probably cloning my repo and just build it: git clone https://github.com/sandreas/audiobookshelf-app.git
cd audiobookshelf-app
npm install
npm run generate
npx cap sync
npx cap open android Then start the Android session of your liking |
I'm not sure this is documented anywhere, but I think currently, it is not possible to enable the ability of navigating to
next
orprevious
via headphone remote control on android.pause
andplay
rewinds 10 seconds by default, which is sane, but I'm missing the other player functions (next, previous, fast forward, rewind) via headphone remote.So there are multiple different implementations / tap codings, where some share common ground (e.g.
toggle play
is almost everywhere a single tap. For android there actually is an expected behaviour: https://source.android.com/docs/core/interaction/accessories/headset/expected-behaviorI would love to see this at least partly configurable. I use a Samsung EG920 EO-EG920BW headset with three buttons (for reference, let's call them
vol+
,vol-
,toggle
):so my personal preference would be:
toggle
toggle
toggle
(alternative: single tap and holdtoggle
)toggle
toggle
This would be the way iPods EarPod remotes work. But I would accept any other implementation as long as the other features are working somehow.
Possible code reference:
audiobookshelf-app/android/app/src/main/java/com/audiobookshelf/app/player/PlayerNotificationService.kt
Line 264 in 394479b
The text was updated successfully, but these errors were encountered: