- (void)viewDidLoad {
[super viewDidLoad];
NSURL *videoURL = [[NSBundle mainBundle]URLForResource:@"thoughtcastAnimate_v02" withExtension:@"mov"];
// create an AVPlayer
AVPlayer *player = [AVPlayer playerWithURL:videoURL];
// create a player view controller
AVPlayerViewController *controller = [[AVPlayerViewController alloc]init];
controller.player = player;
[player play];
// show the view controller
[self addChildViewController:controller];
[self.view addSubview:controller.view];
controller.view.frame = self.view.frame;
// Do any additional setup after loading the view.
}
This works fine with an mp4 file. But I need a .mov file to be played! This is for my application splash screen. I added the .mov file to the assets. Not sure what to do here.
I just needed to add my mov file to the Build Phases
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With