SwiftAudioPlayer icon indicating copy to clipboard operation
SwiftAudioPlayer copied to clipboard

Duration issue research

Open newbdez33 opened this issue 4 years ago • 4 comments

Just a theory.

newbdez33 avatar Sep 13 '21 02:09 newbdez33

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

tanhakabir avatar Sep 28 '21 00:09 tanhakabir

@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.

fingersakimbo avatar Jan 03 '22 16:01 fingersakimbo

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 avatar Jan 06 '22 05:01 newbdez33

@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

micahjon avatar Oct 11 '22 06:10 micahjon