私はios5でビデオを再生しています。私のアプリケーションはランドスケープモードをサポートしています。 Webview
またはMPMoviePlayerController
で再生しても、アプリケーションでフルスクリーンでビデオを再生しているときに、向きを横にロックしたいiosでビデオまたはMPMoviePlayerControllerを再生しているときにWebViewでロックする方向
私はMPMoviePlayerControllerのサブクラスを作成して- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
を実装しましたが、これはcozという名前ではないと思われますので、このメソッドはUIViewController
で利用できます。
動画プレーヤーの向きをロックするのを手伝ってください。
EDIT 3:ここでは は私のコードです:
- (void)showTransferedVideo:(NSNotification*)notification {
viewFileDisplay = [[UIView alloc] initWithFrame:self.view.frame];
[viewFileDisplay setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.70]];
NSString *imagePath = [((MobileJabberAppDelegate*)[[UIApplication sharedApplication] delegate]).strFilePath stringByAppendingPathComponent:
[NSString stringWithFormat:@"%@", [notification object]]];
NSURL *url = [NSURL fileURLWithPath:imagePath];
UIWebView *objWebView = [[UIWebView alloc] initWithFrame:CGRectMake(212, 152, 600, 400)];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[objWebView loadRequest:req];
[viewFileDisplay addSubview:objWebView];
[self.view addSubview:viewFileDisplay];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return(interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight);
}
問題は、iOS 5とするとき、私はフルスクリーンでビデオを再生中にのみ発生します。私は、あなたがそのような風景にUIWebView
を使用してから取得するプレーヤーをロックすることができるとは思わない
おかげ
別のView Controllerでwebview/Movieプレーヤーを作成する必要があります。なぜあなたはBOOLを実装しないのですか?shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation? –
私はすでにこれを行っていますが、webviewはquicktimeプレーヤーでビデオを再生します。 QuickTimePlayerを制御できますか? –
コードを投稿できますか? –