我正在使用此代码尝试播放视频。然而,视频从未播放过,回调也不会说它已经完成。我看不到任何我丢失或不应该出现的东西。我已经检查了路径,这很好。确实会出现视频播放视图。它只是在那个时候不播放。
有什么建议么?
NSURL *movieURL = [[NSBundle mainBundle] URLForResource:@"IntroMovie" withExtension:@"mov"];
NSLog(@"%@", movieURL);
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];
[moviePlayerController prepareToPlay];
[moviePlayerController.view setFrame:self.view.bounds];
[self.view addSubview:moviePlayerController.view];
[moviePlayerController play];