I am trying to read a video file saved as a data file in the XCAssets folder of my project. I am using the following code for this -
NSString *videoFilePath = [[NSBundle mainBundle] pathForResource:@"login_video" ofType:@"mp4"];
NSURL *fileURL = [NSURL fileURLWithPath:videoFilePath];
self.avPlayer = [AVPlayer playerWithURL: fileURL];
self.avPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone;
This code had been working for me for quite sometime with target SDK set to iOS 8. I recently changed to iOS 9, and this now gives me a nil
path and url.
The resource login_video
is stored as a data file in my XCAssets folder.
What am I doing wrong here?
Thanks!