我想让视频在后台播放,文字标签在前面,运行以下代码,视频正在播放,但文字标签不显示!
-(id) init {
if(!(self=[super init])) {
return nil;
}
CGSize size = [[CCDirector sharedDirector] winSize];
// MP4
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test" ofType:@"m4v"]];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[moviePlayer respondsToSelector:@selector(setFullscreen:animated:)];
moviePlayer.controlStyle = MPMovieControlStyleNone;
moviePlayer.shouldAutoplay = YES;
moviePlayer.repeatMode = MPMovieRepeatModeOne;
moviePlayer.view.frame = CGRectMake(0, 0, size.height, size.width);
[viewController.view addSubview:moviePlayer.view];
[viewController.view sendSubviewToBack:moviePlayer.view];
// create and initialize a Label
CCLabelTTF *label = [CCLabelTTF labelWithString:@"Hello World" fontName:@"Marker Felt" fontSize:64];
label.position = ccp( size.width /2 , size.height/2 );
[self addChild: label];
return self;
}