StreamingKit
StreamingKit copied to clipboard
seekToTime seeks to wrong time in song
I'm noticing a problem where my seek function plays the song at the wrong time.
@objc func seek(time: Double) {
dispatch_async(self.methodQueue()) {
if (self.player != nil && self.currentTrack != nil) {
self.player.seekToTime(time)
self.setNowPlayingInfo()
}
}
}
For example, time is set to 90.0, but the song starts playing at the 94th second. I'm comparing with the same song in iTunes. I took out dispatch_async and the same problem still occurs.
Anyone else experiencing this?
StreamingKit estimates the offset for the HTTP RANGE request when seeking based on the average bitrate of the file so far. If you have a VBR encoded file, this can be a bit inaccurate...
@tumtumtum What if the file is local?
@jamesfzhang I did experience the same thing with streamed files. Here's the fix: https://github.com/tumtumtum/StreamingKit/pull/329
But I have no issues with local files.
same issue. seek to wrong right time in song