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
Add sleep at end of chapter #1647
Conversation
Great feature, I need that one. I might look at this, but it seems like the maintainer is currently inactive. 🙁 |
There is a new release out, so hopefully it can be incorporated soon :) |
6b3f9eb
to
11936e6
Compare
Thanks for your contribution! The taken approach is a little hacky though. What do you think about attempting the solution that was suggested here? google/ExoPlayer#10262 (comment) |
That looks like a proper solution, I'll see if I can change it |
The button is fine. I want to rework the UI of that whole thing anyways. |
Hmm the more I think about it I think the suggested approach can't work with setPauseAtEndOf because exoplayer doesn't know anything about the chapter marks. |
85a3a22
to
c96c427
Compare
You mean that it doesn't work if there are multiple chapters within a single audio file? I updated my main branch, I guess it is still not the best solution and could be cleaned up a bit. I added |
a191889
to
54253f9
Compare
61072d0
to
5c55436
Compare
Just a little heads up: I'm currently very busy and want to first focus on stability before pushing new features. So unfortunatelly this PR has to wait for a while. |
No worries, I'll keep the branch updated because I'm using my own build |
Would it make sense to have an option "End of chapter" which sets a timer for the remaining length of the chapter? e.g. when you press the button it just works out the remaining time left and sets that as the timer length? :-) This would allow you to reuse most of the existing timer functionality and you wouldn't need a callback to check the remaining length. |
I did try that first, but wasn't happy with it. It was not that exact, pausing / skipping backwards / changing playback speed etc. messed it up, and fade out would need to be disabled |
a1b84e7
to
db64c34
Compare
Looking great, no hacky timers needed! <3 |
Heads up: |
Wonderful, thank you for the contribution! And sorry for taking ages to merge it 🙈 |
Sorry to tell, but bad news 😢 The implementation has bugs when files contained multiple chapters. As right now the main branch was not releasable for a while I decided to temporarily revert the change until it's bug free. I'm looking forward for an updated PR 🙏 |
That was the limitation of doing this at the ExoPlayer level - I thought you were aware. I was surprised you merged it in the first place ^^ |
Maybe this could be an approach: |
Implements #1323
I'm not familiar with Kotlin and the android media player, so I'm not sure if this is a good way to implement it (periodically check similar to normal sleep timer). Seems a bit hacky to me.
Also, the UI could be improved, but I don't have a better idea right now.
Let me know what you think