UIWebView
(아래 코드 참조) 내에 YouTube 동영상을 재생하려고합니다.iOS 6의 YouTube 플레이어 오리엔테이션 문제
모든 것이 정상적으로 작동하지만 YouTube 플레이어는 iOS 6에서 방향 변경을 지원하지 않습니다. 전체 앱이 세로 모드에만 있습니다.
어떻게이 문제를 해결할 수 있습니까? 어떤 도움을 주셔서 감사합니다.
내가 사용하고있는 코드는 다음과 같습니다 : 당신이해야 할 것입니다 무엇
- (void)viewDidLoad
{
[super viewDidLoad];
float width = 300.0f;
float height = 300.0f;
youTubeURL = @"http://www.youtube.com/embed/ZiIcqZoQQwg";
UIWebView *wv = [[UIWebView alloc] init];
wv.frame = CGRectMake(10, 80, width, height);
NSMutableString *html = [[NSMutableString alloc] initWithCapacity:1] ;
[html appendString:@"<html><head>"];
[html appendString:@"<style type=\"text/css\">"];
[html appendString:@"body {"];
[html appendString:@"background-color: black;"];
[html appendString:@"color: white;"];
[html appendString:@"}"];
[html appendString:@"</style>"];
[html appendString:@"</head><body style=\"margin:0\">"];
[html appendFormat:@"<embed id=\"yt\" src=\"%@\"", youTubeURL];
[html appendFormat:@"width=\"%0.0f\" height=\"%0.0f\"></embed>", 300.0f, 300.0f];
[html appendString:@"</body></html>"];
[wv loadHTMLString:html baseURL:nil];
[self.view addSubview:wv];
}
플레이어의보기 컨트롤러 (전체 스크린 비디오보기 컨트롤러)가 회전하려고합니까? 또는 플레이어가 전체 화면으로 표시 할 수 없으며 'UIWebview'(또는 뷰 컨트롤러가 포함 된)를 회전 시키길 원합니까? –
플레이어의보기 컨트롤러를 회전하여 장치 방향에 따라 회전하려고합니다. –