У меня есть UIWebView, заполненный таким образом:
[myWebView loadHTMLString:@"<iframe src=\"http://www.youtube.com/embed/grTCDFbhKMU\" frameborder=\"0\" allowfullscreen></iframe>"
baseURL:nil];
Видео правильно запущено, но невозможно переключиться в ландшафтный режим.
Я уже писал это в соответствующейViewController:
- (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)];
}
}
Полезно для изменения ориентации контента, но бесполезно после запуска видео: (
Есть идеи?