iphone - Youtube 嵌入 html for uiwebview 不工作(在 iOS 4.2 iPhone 3G 上)

标签 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 使用不同的嵌入代码吗?我应该完全使用不同的嵌入代码吗?

非常感谢任何建议。

谢谢你们。

傻瓜

最佳答案

试试这个:

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

它使用 HTML5-video 元素而不是指 flash。

关于iphone - Youtube 嵌入 html for uiwebview 不工作(在 iOS 4.2 iPhone 3G 上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7268185/

相关文章:

iphone - 阻止移动Safari预加载HTML5音频

iphone - 数组值递减

iphone - 显然我不知道如何写一个setter

ios - ARKit : How to apply material with multiple colors for SCNCylinder in SCNView?

ios - UIButton - 复选标记未显示

objective-c - 创建 IBOutlet 还是 UIView?

iphone - UISegmentedControl、UIToolbar 和 UINavigationItem

iphone - 我是否可以拥有同一应用程序的不同版本,一个用于 iPhone 4 Retina 显示屏,另一个用于较旧的设备?

iphone - 在 UITableViewCell 中保存图像

ios - 编辑后 UITextField 检查为空