Replies: 4 comments 1 reply
-
Hi @PaulWoitaschek - any thoughts on this? Would a PR be welcome? |
Beta Was this translation helpful? Give feedback.
-
I have a general idea on how this can be completed, the sleeptimer needs to receive some kind of signal from the service (MediaSessionCompat.Callback) triggered, either from a direct callback or via other channels e.g. a global singleton source OR via a broadcast source). It is difficult to directly code a callback as the player service is decoupled from the sleeptimer. |
Beta Was this translation helpful? Give feedback.
-
Hi @nydrani I've added a simple idea via the PR $1154. Basically, I have not compiled this (as I don't have those skills), but conceptually, the idea is
This has the disadvantage that the new period is essentially the sleep period plus the timeout period, but to me that really doesn't matter. The idea is this. Here https://github.com/PaulWoitaschek/Voice/blob/main/sleepTimer/src/main/kotlin/voice/sleepTimer/SleepTimer.kt consider
At the point marked
The sleep timer exists, and if the play state is playing, then restart the sleep timer. |
Beta Was this translation helpful? Give feedback.
-
A hacky way to do this
|
Beta Was this translation helpful? Give feedback.
-
It's amazing that
Feature request
I would like to be able to restart the timer via a play/pause button, typically on headphones (wired or bluetooth). For example, when listening on headphones or via a pillow-speaker, the phone may not be all that close to allow shaking to restart; however, it may be easy to restart the player via the play/pause button on headphones.
The issues #742, #988 are related to this. There are two options:
Edit (2022-02-25): I can see that Option 1 is consistent with the shake behaviour.
However, I can see Option 2 being more useful: e.g., people forgetting to put the sleep timer on (#742) or simply restarting listening again without having to set up the sleep timer. Therefore, I prefer Option 2.Option 1 may have a simple fix (see below) and does meet my use case - so I'd be perfectly happy with it.UI
There would probably need to be an option in the UI somewhere. I don't really mind how that's done. Obviously, Voice takes a lean approach, so the option would need to be unobtrusive. A simple option, proposed in the other issues, is to add a check-box to the sleep timer menu, e.g. 'resume sleep timer on play' or similar.
Bounty
If @PaulWoitaschek agrees with the change (and would accept a PR), I'd like to offer a USD 50 bounty for the implementation of this feature (implemented as a PR on https://github.com/PaulWoitaschek/Voice as well as a downloadable apk, based off 5.0.2). (@PaulWoitaschek - if you're interested, I'd obviously also be happy to pay the bounty to you.)
Any interest?
Beta Was this translation helpful? Give feedback.
All reactions