小编NIG*_*INS的帖子

UIWebView流媒体YouTube不会在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)

任何帮助,将不胜感激

youtube iphone fullscreen uiwebview ipad

6
推荐指数
1
解决办法
768
查看次数

标签 统计

fullscreen ×1

ipad ×1

iphone ×1

uiwebview ×1

youtube ×1