我正在使用视频进行启动画面但它没有播放,它显示黑屏,这是我的代码
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
NSString* moviePath = [[NSBundle mainBundle] pathForResource:@"hello" ofType:@"mp4"];
NSURL* movieURL = [NSURL fileURLWithPath:moviePath];
playerCtrl = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
playerCtrl.scalingMode = MPMovieScalingModeFill;
playerCtrl.controlStyle = MPMovieControlStyleNone;
playerCtrl.view.autoresizingMask =UIViewAutoresizingFlexibleHeight;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish)
name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
[self.window addSubview:playerCtrl.view];
[playerCtrl play];
答案 0 :(得分:0)
您可以尝试将播放器视图框设置为窗口边界吗?