2
- (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.
}
を.movファイルを再生していません。しかし、再生する.movファイルが必要です!これは私のアプリケーションのスプラッシュ画面です。 .movファイルをアセットに追加しました。ここで何をすべきかわからない。AVPlayerこれはmp4ファイルで正常に動作します
最初に 'addSubiew'を呼び出し、' play'を呼び出してみてください。 – Shebuka
は働いていません。無限大のローディングサークルを持つ黒い画面があります。 – digit
は、私は、コードNSURLの私のラインに気づい* videoURL = [[NSBundle mainBundle] URLForResource: "thoughtcastAnimate_v02" withExtension @: "MOV" @]。 NIL は – digit