I'm writing a wrapper to create an Audio player using AVQueuePlayer
. I want to be able to update the items (update the playlist, add, remove from playlist...) the only way that I have found is this:
var audioPlayer = AVQueuePlayer()
public var playerItems : [AVPlayerItem] = [] {
didSet {
self.audioPlayer.removeAllItems()
playerItems.forEach({ self.audioPlayer.insert($0, after: nil)})
}
}