Duration issue research
Just a theory.
what's your theory behind why the duration was off? When I try to follow your edits it seems logically the same as what it was before in terms of how predicted duration and duration is updated
@newbdez33 Is this an attempt to solve the problem where you scrub into a file that's streaming (downloaded doesn't appear to have this problem) and it results in the needle exceeding the duration at the end of the file? I was about to dig into that problem, but if you're attempting to address it here, I'll dig into your code instead.
Sorry for late reply. I don't have time to solve this problem so far. And Yes, the needle is exceeding the duration. (some hosting provider adding advertise content into mp3 caused this problem. like this one: https://rss.art19.com/business-wars-daily)
@newbdez33 , thanks a million for your work on this. I made a fork that incorporates your changes.
Additionally, I had to tweak the predictedStreamDuration didSet observer so it didn't set duration back to the stream-predicted value (causing the lock screen duration to constantly switch between 2 values and the needle not to update).
Anyway, just figured I'd post the commit in case any others are running into this. I'll plan on maintaining this fork until some of these PR's are merged. https://github.com/micahjon/SwiftAudioPlayer/commit/3ff0824514ab3b77c537c375ee30541a0533f462