YouTube视频无法加载iOS UIWebView

时间:2011-09-23 06:39:32

标签: ipad uiwebview youtube ios4

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

Stuck YouTube load

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

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)并且不认为它会影响此问题。

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

2 个答案:

答案 0 :(得分:-1)

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

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

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

答案 1 :(得分:-1)

(回答我自己的问题)

行。我很确定我想出来了。有些视频没有移动播放器。你可以在这里查看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还没有为移动设备编码。或者它仅限于移动设备。无论如何,这些类型的视频都不适合我。