YouTube のビデオを横向きモードで再生しようとしています。サポートされているデバイスの向きのために横向きをオフにしました。オンにすると、すべてのビューを横向きにすることができるからです。これを iOS 6 用に作成しています。動画を横向きで再生するにはどうすればよいですか。
これが私のコードです
#import "VideoTViewController.h"
#import "HCYoutubeParser.h"
#import <MediaPlayer/MediaPlayer.h>
@interface VideoTViewController ()
@end
@implementation VideoTViewController
@synthesize tLabel;
-(IBAction)playVideo
{
NSDictionary *videos = [HCYoutubeParser h264videosWithYoutubeURL:[NSURL URLWithString:@"http://www.youtube.com/watch?v=zz_bJ58LfCg&feature=youtu.be"]];
MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:[videos objectForKey:@"medium"]]];
[self presentViewController:mp animated:YES completion:nil];
}
編集:
私は次のことをしました:
新しいクラスを作りました
AboutNavViewController (UiNavigationController のサブクラス)
#import "AboutNavViewController.h"
@interface AboutNavViewController ()
@end
@implementation AboutNavViewController
- (BOOL)shouldAutorotate {
return NO;
}
- (BOOL)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
@end
そして私のaboutviewcontroller(uiviewcontrollerをサブクラス化する)で
#import "AboutViewController.h"
#import "AboutNavViewController.h"
@interface AboutViewController ()
@end
@implementation AboutViewController
@synthesize aLabel;
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect frame = CGRectMake(0, 0, 320, 44);
aLabel = [[UILabel alloc] initWithFrame:frame];
aLabel.backgroundColor = [UIColor clearColor];
[aLabel setFont:[UIFont fontWithName:@"SerifGothic LT Black" size:25]];
aLabel.text = @"Sephardi Jews";
aLabel.textAlignment = NSTextAlignmentCenter;
aLabel.textColor =[UIColor whiteColor];
self.navigationItem.titleView = aLabel;
AboutNavViewController *about = [[AboutNavViewController alloc] init];
[self presentViewController:about animated:YES completion:nil];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
@end
次のエラーが表示されます。
の外観トランジションの開始/終了の不均衡な呼び出し。
私は何を間違っていますか?