Hello.
I'm trying to code a simple video player to play a simple mp4 file.
So I put in the code and I received an error:
So I thought that I must have misspelled the file name. When I went to check, I noticed I didn't misspell.
After an hour of trying, I finally went and copied the code from another app of mine that I had just tested. I didn't work.
Here's the code:
I'm trying to code a simple video player to play a simple mp4 file.
So I put in the code and I received an error:
Code:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
So I thought that I must have misspelled the file name. When I went to check, I noticed I didn't misspell.
After an hour of trying, I finally went and copied the code from another app of mine that I had just tested. I didn't work.
Here's the code:
Code:
NSString *path = [[NSBundle mainBundle] pathForResource:@"Video" ofType:@"mp4"];
NSURL *url = [NSURL fileURLWithPath:path];
MPMoviePlayerViewController *moviePlayerView = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
moviePlayerView.moviePlayer.controlStyle = MPMovieControlStyleNone;
[self presentMoviePlayerViewControllerAnimated:moviePlayerView];