【问题标题】:Play youtube video within iphone app在 iphone 应用程序中播放 youtube 视频
【发布时间】:2012-04-05 08:13:39
【问题描述】:

我需要在我的 iPhone 应用中播放一些 youtube 视频,我可以使用原生 youtube 应用吗?

我尝试嵌入视频,但效果不佳。

谁能帮帮我?

谢谢

【问题讨论】:

    标签: iphone video youtube


    【解决方案1】:

    您可以创建一个新的UIWebView 并在其中打开m.youtube.com 链接。

    【讨论】:

    【解决方案2】:

    播放 YouTube 视频的最简单方法是使用 YouTube 的 URL 方案。打开 YouTube URL 将在 YouTube 应用而不是 Safari 中打开视频:

    NSString *stringURL = @"http://www.youtube.com/watch?v=WZH30T99MaM";
    NSURL *url = [NSURL URLWithString:stringURL];
    [[UIApplication sharedApplication] openURL:url];
    

    【讨论】:

    • 是的,我试过了,它关闭了我的应用程序我需要在我的 iPhone 应用程序中运行它
    猜你喜欢
    • 2011-11-16
    • 2011-04-25
    • 1970-01-01
    • 2014-02-01
    • 1970-01-01
    • 2012-02-22
    • 2012-07-05
    • 1970-01-01
    • 2011-08-27
    相关资源
    最近更新 更多