- (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.