如何在没有 uiwebview 的情况下在 iPhone 上播放 YouTube

发布于 2025-01-03 00:52:44 字数 610 浏览 5 评论 0原文

可能的重复:
在应用程序外部加载 YouTube

在应用程序外部加载 YouTube 我需要在iPhone 没有 UIWebView

就像这个

Possible Duplicate:
Load YouTube outside Application

I need to start the YouTube player on the iPhone without UIWebView.

Like this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

星光不落少年眉 2025-01-10 00:52:44

您应该只需打开 URL 即可打开 YouTube 应用程序:

NSString *stringURL = @"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos";
NSURL *url = [NSURL URLWithString:stringURL];
UIApplication* application = [UIApplication sharedApplication];
[application openURL:url];

您应该使用指向 application/x-shockwave-flash 媒体标记的媒体标记。请注意,您必须在 iPhone 上尝试此操作,因为它在模拟器中不起作用。

You should be able to open YouTube application by just opening the URL:

NSString *stringURL = @"http://www.youtube.com/v/oHg5SJYRHA0&f=gdata_videos";
NSURL *url = [NSURL URLWithString:stringURL];
UIApplication* application = [UIApplication sharedApplication];
[application openURL:url];

You should use the media tag which points to the application/x-shockwave-flash media tag. Please note that you have to try this on the iPhone, as it does not work in the simulator.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文