iOS: How to use MPMoviePlayerController

后端 未结 4 1904
刺人心
刺人心 2020-12-08 00:54

I\'ve created a blank project (iOS) and put this in my viewDidLoad:

NSString *moviePath = [[NSBundle mainBundle] pathForResource:@\"Movie\" ofType:@\"m4v\"];         


        
4条回答
  •  借酒劲吻你
    2020-12-08 01:22

    Try add

    [player prepareToPlay];
    

    after

    MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:url];
    

    You can read more about MPMoviePlayerController in Apple documentation: http://developer.apple.com/library/ios/#documentation/mediaplayer/reference/MPMoviePlayerController_Class/Reference/Reference.html#//apple_ref/doc/c_ref/MPMoviePlayerController

提交回复
热议问题