【发布时间】:2011-01-01 19:02:05
【问题描述】:
我需要在我的 iphone 应用程序中将视频显示为启动画面 我正在使用以下代码:
-(void)setupMovie{
NSString* moviePath = [[NSBundle mainBundle] pathForResource:@"iphone" ofType:@"mp4"];
NSURL* movieURL = [NSURL fileURLWithPath:moviePath];
playerCtrl = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
playerCtrl.scalingMode = MPMovieScalingModeFill;
playerCtrl.controlStyle = MPMovieControlStyleNone;
playerCtrl.view.frame = CGRectMake(0, 0, 480, 320);
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
[playerCtrl.view setCenter:CGPointMake(240, 160)];
[playerCtrl.view setFrame:CGRectMake(0, 0, 480, 320)];
[playerCtrl.view setTransform:CGAffineTransformMakeRotation(-M_PI/2)];
[self.window addSubview:playerCtrl.view];
[playerCtrl play];}
但是玩家视图不是从 x=0,y=0 位置开始的。是什么原因以及如何解决。 它的起始 x=100,y=100(大约)。
【问题讨论】:
标签: iphone video splash-screen