Im having trouble playing urls that are saved in my documents folder. I first download the videos from the server and save the path to the videos to my app documents folder. When I pull up the paths from the devices,AVplayer is just blank. Here is my code:
VideoPlayer *vidPlayer = (VideoPlayer *)[self.view viewWithTag:500];
NSString* path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString *filepath = [path stringByAppendingPathComponent:@"Data.dat"];
NSMutableArray *listOfVideos = [NSKeyedUnarchiver unarchiveObjectWithFile:filepath];
NSURL *fileURL = listOfVideos[0][@"video"];
AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:fileURL options:nil];
AVPlayerItem *firstItem = [[AVPlayerItem alloc] initWithAsset:asset];
_queuePlayer =[[AVQueuePlayer alloc]initWithPlayerItem:firstItem];
AVPlayerLayer *layer = (AVPlayerLayer *)vidPlayer.layer;
layer.player = _queuePlayer;
[_queuePlayer play];