Youtube为uiwebview嵌入了html无法正常工作(在iOS 4.2 iPhone 3G上)

时间:2011-09-01 09:05:47

标签: iphone objective-c ios uiwebview youtube

我有一个UIWebView,其中包含以下嵌入代码:

<embed id="yt" src="http://www.youtube.com/watch?v=1T6YM7RE5wQ" type="application/x-shockwave-flash" width="280" height="186"></embed>

这在我的iPhone 4(iOS 4.3)上运行正常,但在iPhone 3G(iOS 4.2)上进行测试时,会出现全屏YouTube播放器,但会在“正在加载电影......”中停顿/挂起

我应该为4.2使用不同的嵌入代码吗?我应该完全使用不同的嵌入代码吗?

任何建议都非常感谢。

谢谢你们。

dunc

1 个答案:

答案 0 :(得分:1)

请改为尝试:

<iframe id="yt" class="youtube-player" type="text/html" width="280" height="186" src="http://www.youtube.com/embed/1T6YM7RE5wQ" frameborder="0">

它使用HTML5-video元素而不是引用闪光灯。