【问题标题】:YouTube video fails to load with iOS UIWebViewYouTube 视频无法使用 iOS UIWebView 加载
【发布时间】:2011-11-23 10:08:43
【问题描述】:

我们正在开发一个使用 UIWebView 加载 YouTube 视频的 iPad 应用 (iOS 4.3.5)。大约五分之一的 YouTube 视频将无法加载,我只看到以下带有 YouTube 徽标的空白屏幕:

查看调试日志我只能看到以下警告:

warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.5 (8L1)/Symbols/System/Library/Internet Plug-Ins/QuickTime Plugin.webplugin/QuickTime Plugin (file not found).
warning: No copy of QuickTime Plugin.webplugin/QuickTime Plugin found locally, reading from memory on remote device.  This may slow down the debug session.

我已阅读有关此警告 (https://stackoverflow.com/questions/7149593/warning-while-playing-a-video-link-in-my-app) 的信息,并且认为它不会影响此问题。

有谁知道如何解决这个问题?

【问题讨论】:

  • 邮政编码供参考。
  • 我们正在使用这个代码:<html><head><body style=\"margin:0\"><embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\"width=\"%0.0f\" height=\"%0.0f\"></embed></body></html> 这些变量是从另一个函数传入的。提前感谢您的帮助!

标签: ipad uiwebview youtube ios4


【解决方案1】:

尝试使用 HTML 5 的视频标签。我对视频标签做了同样的事情,它与我的应用程序完美配合。

下面是相同的示例代码...

<html><head><video controls=\"controls\"><source src=\"%@\" type=\"video/mp4\" height=\"%0.0f\" width=\"%0.0f\"/></video></body></html>

【讨论】:

  • 他在说youtube视频,标签有什么关系?
【解决方案2】:

(回答我自己的问题)

好的。我很确定我想通了。有些视频没有移动播放器。您可以在此处查看 JSON 输出:

http://gdata.youtube.com/feeds/api/videos/TWfph3iNC-k?v=2&alt=jsonc

这里:

http://gdata.youtube.com/feeds/api/videos/cd4jvtAr8JM?v=2&alt=jsonc

请注意第二个视频 (cd4jvtAr8JM) 没有移动播放器链接。我想这意味着 YouTube 还没有针对移动设备进行编码。或者它仅限于移动设备。无论如何,这些类型的视频都不会为我播放。

【讨论】:

    猜你喜欢
    • 2017-02-10
    • 2014-04-02
    • 2013-06-14
    • 2015-05-05
    • 2017-06-18
    • 1970-01-01
    • 2012-01-18
    • 2018-06-11
    • 2014-01-16
    相关资源
    最近更新 更多