So I’m trying to play a video and the following code has worked for me with other video files so far but today I rendered out a new video (same rendering process as before so it should work – compression h.264 from AE and file is 14.7mb), dropped it in, change the name of the file and tried to run the app but it crashed and gave me a SIGBART error with this error:
* Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘* -[NSURL initFileURLWithPath:]: nil string parameter’
Now this sounds like it can’t find the video file but it’s in my sidebar with all my other video files that have worked with the same code and everything. I’m at a bit of a loss here… any help would be greatly appreciated.
I’m pretty sure I’ve supplied all the code that you would need to see what’s going on but if you need anything else, let me know and I’ll update the post with it.
Thanks again!
Matt
NSURL *videoURL2 = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Comp 2" ofType:@"mp4"]];
MPMoviePlayerController *player2 = [[MPMoviePlayerController alloc] initWithContentURL: videoURL2 ];
UIImage *thumbnail2 = [player2 thumbnailImageAtTime:13.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
player2.shouldAutoplay = NO;
player2.stop;
player2 = nil;
UIImageView *videoPicture2 = [[UIImageView alloc]initWithImage:thumbnail2];
videoPicture2.layer.shadowOffset = CGSizeMake(1, 1);
videoPicture2.layer.shadowRadius = 1;
videoPicture2.layer.shadowColor = [UIColor blackColor].CGColor;
videoPicture2.layer.shadowOpacity = 0.3f;
videoPicture2.layer.borderWidth = 1;
videoPicture2.layer.borderColor = [UIColor colorWithRed:0.0f green:0.0f blue:0.0f alpha:0.1f].CGColor;
videoPicture2.frame = CGRectMake(145, 3, 82, 54);
The problem was that the video was not added to the Target