私は、このコードMPMoviePlayerViewControllerが動作しますが、MPMoviePlayerControllerは動作しません。なぜですか?
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"d" ofType:@"mp4"];
NSURL *url = [NSURL fileURLWithPath:filepath];
//part 1
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL: url];
[player.view setFrame: self.view.bounds];
//[player prepareToPlay];
//[player setShouldAutoplay:YES];
//[player setControlStyle:2];
[self.view addSubview: player.view];
[player play];
//part2
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
[[mp moviePlayer] prepareToPlay];
[[mp moviePlayer] setShouldAutoplay:YES];
[[mp moviePlayer] setControlStyle:2];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:mp];
[self presentMoviePlayerViewControllerAnimated:mp];
その2作品を持っている...彼らは同じURLを使用していないPART1と私はほとんど私が使用しているcopyedとADCサイト
からスニペットを貼り付けましたios5
パート2を含むためのおかげで一部だけを見たことがあり、あなたのあなたの.hファイルを持っている必要がありますので、
1のコードの周りにそれはちょうど動作しないので私を狂って運転してきた。パート2のコードは素晴らしいです! – scum