amugofjava / anytime_podcast_player

Simple, easy to use Podcast player app written in Flutter and Dart.
BSD 3-Clause "New" or "Revised" License
376 stars 99 forks source link

#107 Playback progress save. #108

Closed Chralu closed 4 months ago

Chralu commented 9 months ago

Fixes #107

amugofjava commented 9 months ago

Hi @Chralu,

It is frustrating when Anytime does not save an episode's current position, but I don't believe increasing the update frequency is the solution. Sembast is an in-memory NoSQL store which appends to a file on every write. Writing on every action, especially every 500ms tick, would generate a lot of I/O. A 1 hour show, for example, would generate 7,200 writes.

I would like to better understand how Anytime is failing. When Anytime is playing, it should be less likely to be killed by the OS. When paused, it should have already saved its current position, and when the app is suspended it also saves the current position. What I am not sure about is what happens when Anytime is interrupted by something like a call.

The best solution is one where Anytime correctly handles situations where it needs to save, thus ensuring it does not forget its position whilst minimising the about of I/O.

Chralu commented 9 months ago

Hi @amugofjava ,

I agree with you. My solution is a (pretty inefficient) workaround to application brutal stops.

For the story : A few weeks ago, I used to experience application unexpected stops while playing in background (on iOS). I had no time to investigate, so I have no clue of the root issue (maybe is it fixed by now)...

Anyway, would it be pertinent to save playback progress on rewind/fastfoward/seek actions when playback is paused ?

amugofjava commented 9 months ago

Hi @Chralu,

When you say it randomly stops on iOS during playback, is the playback just stopping or is the application crashing?

Chralu commented 9 months ago

Hi @amugofjava

I don't know if application crashed or stopped 🤔 Maybe AppStore crash logs existence could help to determine this.

Chralu commented 9 months ago

I have identified a way to reproduce the behavior. And I think system just stops the application.

  1. Start a podcast playback
  2. Go on iPhone home page
  3. Lock the iPhone

After 15min application is killed by the OS.

If step 2 is omitted (application is in foreground, and phone is locked), then application is not killed by OS.

amugofjava commented 9 months ago

Hi @Chralu,

I've tried this myself a few times and it plays past 15 minutes; however, I am generally stuck on iOS 15. What version of iOS are you running? I did have a few issues with iOS that I'd hoped were fixed.

Chralu commented 9 months ago

Hi @amugofjava ,

I'm using iOS 16.6.1.

Chralu commented 4 months ago

Related Issue seems fixed.