iOS: AVQueuePlayer/AVPlayerItem 'An AVPlayerItem can occupy only one position in a player's queue at a time.'
- by JoshDG
I keep getting this error:
'An AVPlayerItem can occupy only one position in a player's queue at a
time.'
I NSLog'd the players items, and none of them seem to be equal. Further, I added this just to be sure:
if([player canInsertItem:itemToAdd afterItem:nil])
[player insertItem:itemToAdd afterItem:nil];
When I wasn't sure if that would work (can have two identical items in different memory locations) I wrote a category method to test if a player contains an item or something identical to it. Yet, I'm still getting the error.
I've seen several posts of people getting this error with MPMoviePlayerController, but I'm not using that custom class, just the out of the box AVQueuePlayer.
Any ideas on how to fix this?