내 MPMoviePlayerController보기가 다른보기 컨트롤러보기에 하위보기로 추가되었습니다. 동영상을 전체 화면으로 재생하고 시뮬레이터를 넘기면 동영상이 뒤집히지 않으며 부모보기도 표시되지 않습니다. 그러나 회전 방법 (아래의 검사 코드)에 return YES
을 추가하면 원하는대로 전체 화면에있을 때 비디오가 회전하지만 부모보기도 회전합니다. 풍경이 디자인되어 있지 않기 때문에 원하지 않습니다. 상위 뷰에 대한 뷰. 동영상이 전체 화면이면서 상위보기가 아닌 경우에만 어떻게 회전 할 수 있습니까?MPMoviePlayerController 비디오를 회전하는 방법 (수퍼 뷰에서는 회전하지 않음)
여기 내가 사용하는 코드는 다음과 같습니다
- (void)viewDidAppear:(BOOL)animated {
NSBundle *bundle=[NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"MainPageMovie" ofType:@"mp4"];
NSURL *movieURL=[[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
theMovie.view.frame = CGRectMake(115.0, 156.0, 200.0, 150.0);
[self.view addSubview:theMovie.view];
[theMovie play];
[super viewDidLoad];
self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];
}
그리고 회전 방법 :
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}
그래서 기본적으로 전체 앱에 대한 가로보기를 디자인하거나 세로보기로 동영상을 계속 재생할 수 있도록 부모보기에 대한 가로보기를 디자인합니까? : P 어쨌든 고마워 :) 비디오를 별도의보기에 추가하려고 노력할 것이다. 이것은 내 문제를 해결한다 :) –