So I'm trying to play a simple intro animation video file that I've dragged into my project in XCode and therefore should be able to play from my mainBundle, right?
With this code:
NSURL *urlString = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"introvideo" ofType:@"mp4"]];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:urlString];
[player play];
I get this error message:
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSURL initFileURLWithPath:]: nil string parameter'
Any help would be great!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…