NIG*_*INS 6 youtube iphone fullscreen uiwebview ipad
我有一个按钮,取消隐藏UIWebView,然后流式传输YouTube视频.在iPhone上它工作正常,按下播放按钮直接进入全屏,然后当它完成按下完成按钮隐藏UIWebView并将控制返回到应用程序.
然而,当我尝试在iPad上一样,压着打不自动切换到全屏(你可以按下全屏控制,但我不希望用户有这样的选择) - 是有办法做到这一点吗?
我的代码是:
- (IBAction)topButton:(id)sender {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerWillExitFullscreenNotification" object:nil];
videoWebView.hidden=NO;
NSString *embedcode = [self.detailItem objectForKey:@"youtubeEmbedCodeBeginner"];
[[self videoWebView]loadHTMLString:embedcode baseURL:nil];
}
Run Code Online (Sandbox Code Playgroud)
和:
-(void)youTubeFinished:(NSNotification *)notification{
// your code here
videoWebView.hidden=YES;
}
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激
小智 0
尝试这个
选择器:@selector(someSelector)名称:@“UIMoviePlayerControllerDidEnterFullcreenNotification”对象:nil]
// 对于 iOS 4.3 及以上版本: UIMoviePlayerControllerDidEnterFullscreenNotification UIMoviePlayerControllerDidExitFullscreenNotification
// 对于 iOS 4.2 及以下版本: UIMoviePlayerControllerDidEnterFullcreenNotification UIMoviePlayerControllerDidExitFullcreenNotification
谢谢
| 归档时间: |
|
| 查看次数: |
768 次 |
| 最近记录: |