Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVPlayer not playing .mov files

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

like image 365
digit Avatar asked Oct 28 '22 23:10

digit


1 Answers

I just needed to add my mov file to the Build Phases

like image 141
digit Avatar answered Nov 11 '22 17:11

digit