gpt4 book ai didi

iphone - UIWebView 流媒体 YouTube 在 iPad 上无法全屏显示

转载 作者:行者123 更新时间:2023-12-03 18:47:56 32 4
gpt4 key购买 nike

我有一个按钮,可以取消隐藏 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];
}

和:

-(void)youTubeFinished:(NSNotification *)notification{
// your code here
videoWebView.hidden=YES;
}

如有任何帮助,我们将不胜感激

最佳答案

试试这个

选择器:@selector(someSelector)名称:@“UIMoviePlayerControllerDidEnterFullcreenNotification”对象:nil]

//对于 iOS 4.3 及以上版本:UIMoviePlayerControllerDidEnterFullscreenNotificationUIMoviePlayerControllerDidExitFullscreenNotification

//对于 iOS 4.2 及以下版本:UIMoviePlayerControllerDidEnterFullcreenNotificationUIMoviePlayerControllerDidExitFullcreenNotification

谢谢

关于iphone - UIWebView 流媒体 YouTube 在 iPad 上无法全屏显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13839921/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com