我想在默认黑色图像启动后在应用程序中播放 4 秒的视频我该怎么办?请帮我
我的代码在下面
-(void)viewWillAppear:(BOOL)animated
{
NSString* moviePath = [[NSBundle mainBundle] pathForResource:@"intro_anim" ofType:@"mov"];
NSURL* movieURL = [NSURL fileURLWithPath:moviePath];
NSLog(@"%@",movieURL );
playerCtrl = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
[playerCtrl prepareToPlay];
playerCtrl.scalingMode = MPMovieScalingModeFill;
playerCtrl.controlStyle = MPMovieControlStyleNone;
playerCtrl.view.frame = CGRectMake(0, 0, 480, 320);
[playerCtrl.view setCenter:CGPointMake(240, 160)];
[playerCtrl.view setFrame:CGRectMake(0, 0, 480, 320)];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
[playerCtrl play];
[self presentMoviePlayerViewControllerAnimated:playerCtrl.view];
[self.view addSubview:playerCtrl.view];
}