Skip to content

Commit 820b7cf

Browse files
committed
Changed how check on currentProgressionUpdated
PlaybackLikelyToKeepUp is not the way to check if the item is really playing or not.
1 parent 80cde63 commit 820b7cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

AudioPlayer/AudioPlayer/AudioPlayer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ public class AudioPlayer: NSObject {
10771077
- parameter time: The current time.
10781078
*/
10791079
private func currentProgressionUpdated(time: CMTime) {
1080-
if let currentItemProgression = currentItemProgression, currentItemDuration = currentItemDuration, currentItem = player?.currentItem where currentItemDuration > 0 && currentItem.playbackLikelyToKeepUp {
1080+
if let currentItemProgression = currentItemProgression, currentItemDuration = currentItemDuration, currentItem = player?.currentItem where currentItemDuration > 0 && currentItem.status == .ReadyToPlay {
10811081
//This fixes the behavior where sometimes the `playbackLikelyToKeepUp`
10821082
//isn't changed even though it's playing (happens mostly at the first play though).
10831083
if state == .Buffering || state == .Paused {

0 commit comments

Comments
 (0)