I am currently trying to figure out a way to create a playlist from an array of avplayeritems and save the array to the nssuserdefaults but it wont work.
here is some code
AVAsset *asset = [AVAsset assetWithURL:_videoURL];
AAPLPlayerViewController __weak *weakSelf = self;
NSArray *oldItemsArray = [weakSelf.player items];
AVPlayerItem *newPlayerItem = [AVPlayerItem playerItemWithAsset:asset];
[weakSelf.player insertItem:newPlayerItem afterItem:nil];
[weakSelf queueDidChangeFromArray:oldItemsArray toArray:[self.player items]];
i am trying to create a playlist and store the AVPlayerItems from the queue of the AVQueuePlayer but since it has complex data that includes the AVPlayerItem and AVAsset it will crash when i try to save the [self.player items];
Ive also tried to store it to a Mutable dictionary but no methods ive tried have worked. Can anyone with experience suggest a good method of creating a playlist and storing it for the AVQueuePlayer?
I am using the AVFoundationQueuePlayer Objective C sample from the IOS developer downloads at this link :