有没有办法检测视频是否在普通班级的UIWebView中播放。我知道这个代码,如果正在播放视频(在AppDelegate中),方向可以改变,但我不确定如何在我的ViewController类中实现类似于此的代码:
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
id presentedViewController = [window.rootViewController presentedViewController];
NSString *className = presentedViewController ? NSStringFromClass([presentedViewController class]) : nil;
if (window && [className isEqualToString:@"AVFullScreenViewController"] && [presentedViewController isBeingDismissed] == NO) {
return UIInterfaceOrientationMaskAll;
} else {
return UIInterfaceOrientationMaskPortrait;
}}