Related questions
Looping a video with AVFoundation AVPlayer?
Is there a relatively easy way of looping a video in AVFoundation?
I've created my AVPlayer and AVPlayerLayer like so:
avPlayer = [[AVPlayer playerWithURL:videoUrl] retain];
avPlayerLayer = [[AVPlayerLayer playerLayerWithPlayer:avPlayer] retain];
avPlayerLayer.frame = contentView.layer.bounds;
[contentView.layer addSublayer: avPlayerLayer];
and …
iOS: How to use MPMoviePlayerController
I've created a blank project (iOS) and put this in my viewDidLoad:
NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"Movie" ofType:@"m4v"];
MPMoviePlayerViewController *playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]];
[self presentMoviePlayerViewControllerAnimated:playerController];
[playerController.moviePlayer play];
When the app starts all …