【发布时间】:2014-11-19 10:36:23
【问题描述】:
我正在使用视频作为启动画面,但它没有播放,它显示黑屏,这是我的代码
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];
【问题讨论】:
标签: ios objective-c video splash-screen