ランドスケープモードへのUIWebViewから再生をこのように満たされた:自動回転のビデオは、私がのUIWebViewを持って
[myWebView loadHTMLString:@"<iframe src=\"http://www.youtube.com/embed/grTCDFbhKMU\" frameborder=\"0\" allowfullscreen></iframe>"
baseURL:nil];
ビデオが正常に開始しましたが、それは風景モードに切り替えることはできませんされています。
私はすでに懸念のViewControllerでこれを書いている:ビデオは:(
を立ち上げたら、任意のアイデアをコンテンツの向きが、useslessを変更する
- (void)didRotate:(NSNotification *)notification
{
UIDeviceOrientation orientation = [[notification object] orientation];
if (orientation == UIDeviceOrientationLandscapeLeft)
{
[self.newsContent setTransform:CGAffineTransformMakeRotation(M_PI/2.0)];
}
else if (orientation == UIDeviceOrientationLandscapeRight)
{
[self.newsContent setTransform:CGAffineTransformMakeRotation(M_PI/-2.0)];
}
else if (orientation == UIDeviceOrientationPortraitUpsideDown)
{
[self.newsContent setTransform:CGAffineTransformMakeRotation(M_PI)];
}
else if (orientation == UIDeviceOrientationPortrait)
{
[self.newsContent setTransform:CGAffineTransformMakeRotation(0.0)];
}
}
お役立ち
なぜ、webViewは風景モードでYouTubeのビデオを再生しないのですか?私はlandscに回転するメソッドを使ってサブクラスwebviewを試しました –