0
다른 예제를 살펴 보았지만 viewController에서 전체 화면을로드하는 비디오를 가져올 수 없습니다.iPhone MediaPlayer - 전체 화면?
로드 할 수 있지만 전체 화면으로 실행되지 않습니다.
코드는 다음과 같습니다. 감사!
-(void)viewWillAppear:(BOOL)animated {
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"m4v"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlaybackComplete:)
name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];
[moviePlayerController.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.fullscreen = YES;
[moviePlayerController play];
}
- (void) movieFinishedCallback:(NSNotification*) aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player autorelease];
}
편집 : 전체 화면이 고정 ... 난 그냥 추가했다 : moviePlayerController.controlStyle = MPMovieControlStyleFullscreen;
이제 내 상태 표시 줄에 홀수 이미지가 추가됩니다. 첨부 된 사진을 참조하십시오.
감사합니다. Walter ... 전체 화면이 의미하는 바는 전체 화면 버튼을 먼저 탭하지 않고 시작한 후 '완료'버튼을 표시하는 것입니다. –
감사합니다 Walter ...'moviePlayerController.controlStyle = MPMovieControlStyleFullscreen;을 추가했습니다. 어떤 문제가 수정되었습니다. 이제 상태 표시 줄에 이상한 이미지가 나타납니다 ... 업데이트 된 이미지 질문을 봅니다. –