新的 YouTube iframe 代码无法在 iPhone 上显示视频
我们将新的 YouTube iframe 代码添加到我们的新闻网站中。问题是视频没有出现在 iPhone 上。
这是我的页面和代码:
<iframe width="620" height="390" src="http://www.youtube.com/v/A2V1WTF8tp4?hl=en&fs=1&autoplay=0&hd=1" frameborder="0" allowfullscreen="true"></iframe>
如何让 YouTube 视频出现在 iPhone 上?
We added the new YouTube iframe code into our News site. The problem is the video doesn't appear on the iPhone.
Here's my page and code:
<iframe width="620" height="390" src="http://www.youtube.com/v/A2V1WTF8tp4?hl=en&fs=1&autoplay=0&hd=1" frameborder="0" allowfullscreen="true"></iframe>
How can I get YouTube video to appear on the iPhone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
视频的 URL 可能是问题所在。嵌入视频代码如下所示
请注意 URL 如何使用 embed 而不是 v。
The URL for the video might be the problem. The embedded video code goes like this
Notice how the URL uses embed instead of v.
您的问题可能是 YouTube 是基于 Flash 的,因此嵌入 iframe 无法在 iPhone 上运行,因为 iPhone 不支持 Flash。
尝试这样的事情:
代码礼貌: http://learningtheworld.eu/2009/youtube-embed/
Your problem may be that YouTube is Flash based, so embedding an iframe isn't going to work on the iPhone, which doesn't support Flash.
Try something like this instead:
code courtesy of: http://learningtheworld.eu/2009/youtube-embed/
我有一个 UIWebView 的子类来完成此任务,这就是它的工作原理:(
在 init 中:)
只需确保将您的“视频视图”添加为拥有它的视图的子视图。
I have a subclass of UIWebView to accomplish this, and this is how it works:
(in init:)
Just ensure your "video view" is added as a subview of whichever view owns it.