DOUAudioStreamer icon indicating copy to clipboard operation
DOUAudioStreamer copied to clipboard

[streamer currentTime]的值大于[streamer duration]

Open devfxg opened this issue 9 years ago • 6 comments

播放结束时打印的值currentTime --- 25.977000 , duration --- 15.479000

devfxg avatar Jun 22 '16 09:06 devfxg

正在播放的时候,我切换到后台,虽然调用暂停方法了,也暂停掉了,但是currentTime还一直在累加

devluyy avatar Jun 24 '16 01:06 devluyy

可能是 timer 没有 invalidate() 的原因?

johnlui avatar Jul 01 '16 09:07 johnlui

@johnlui 这和时间累加没有关系吧,用的时候用个计时器只是用来更新时间的, 具体当前已播放时间是根据- (NSTimeInterval)currentTime算出来的

(NSTimeInterval)currentTime { return (NSTimeInterval)((NSUInteger)[[self currentStreamer] timingOffset] + [_renderer currentTime]) / 1000.0; }

还是你说的这个这个timer是库里面的timer?

devluyy avatar Jul 01 '16 09:07 devluyy

不是 😂 我看看我又没有这个问题

johnlui avatar Jul 01 '16 09:07 johnlui

@johnlui 你在收到这个通知UIApplicationDidEnterBackgroundNotification里面调用[steamer pause],可以复现 我现在使用这个通知UIApplicationWillResignActiveNotification,然后没这个问题了

devluyy avatar Jul 01 '16 09:07 devluyy

👍
我没这个需求,那我就不看了。。。

johnlui avatar Jul 01 '16 10:07 johnlui