Open devfxg opened 8 years ago
正在播放的时候,我切换到后台,虽然调用暂停方法了,也暂停掉了,但是currentTime还一直在累加
可能是 timer 没有 invalidate() 的原因?
@johnlui 这和时间累加没有关系吧,用的时候用个计时器只是用来更新时间的, 具体当前已播放时间是根据- (NSTimeInterval)currentTime算出来的
(NSTimeInterval)currentTime { return (NSTimeInterval)((NSUInteger)[[self currentStreamer] timingOffset] + [_renderer currentTime]) / 1000.0; }
还是你说的这个这个timer是库里面的timer?
不是 😂 我看看我又没有这个问题
@johnlui 你在收到这个通知UIApplicationDidEnterBackgroundNotification里面调用[steamer pause],可以复现 我现在使用这个通知UIApplicationWillResignActiveNotification,然后没这个问题了
👍
我没这个需求,那我就不看了。。。
播放结束时打印的值currentTime --- 25.977000 , duration --- 15.479000