3

I'm using AVPlayer to play streamed network audio. I observer status of the streamed item as this post:

ios avplayer trigger streaming is out of buffer

Work seems well, but I encounter a strange problem. I meet the key "playbackLikelyToKeepUp" before the key "playbackBufferEmpty". I placed a log

NSLog(@"___path: %@", path)

in the first line of the function

observeValueForKeyPath.....

and the log I received is:

...
2012-10-29 17:24:35.412 NhacSo[236:907] ___path: rate
2012-10-29 17:24:35.413 NhacSo[236:907] ___path: playbackLikelyToKeepUp
2012-10-29 17:24:35.415 NhacSo[236:907] ___path: playbackBufferEmpty
2012-10-29 17:24:35.416 NhacSo[236:907] ___path: rate
...

Do you know why I receive "playbackLikelyToKeepUp" before "playbackBufferEmpty"? Thank you!!!

Community
  • 1
  • 1
vietstone
  • 8,784
  • 16
  • 52
  • 79

1 Answers1

2

You receive playbackLikelyToKeepUp first because that property changes first. What I believe is confusing you is that it changes from YES to NO and not the other way around - that is, playback will no longer be able to keep up.

emidander
  • 2,383
  • 22
  • 29