0

I have audio playing in AVQueuePlayer and associated album artwork on UIImage-via MPMediaPickerController. I populate array with URLs from MPMediaPickerController, then create array of AVPlayerItems(init with URL) which feeds AVQueuePlayer. When the next song in queue begins, I'd like the album artwork to change accordingly. Given my current setup, is it possible to receive AVPlayerItemDidPlayToEndTimeNotification to accomplish this goal? Between the Apple documentation and web searches, I have not found anything that confirms the ability to get song end notification within a queue. That's the sticking point.

Many thanks....

Mickey
  • 313
  • 2
  • 13

1 Answers1

0

Use Key-Value Observing with NSKeyValueObservingOptionNew, and listen to the AVQueuePlayer's currentItem property. Whenever it changes, you will be notified and you will be able to extract the AVPlayerItem and identify it through it's asset property.

lawicko
  • 7,246
  • 3
  • 37
  • 49