8

关于是否应该使用 OBJECT 或 IFRAME 进行视频嵌入的问题已经被问到......

我应该使用 <object> 还是 <iframe> 来加载视频?

但我的问题更进一步。如果专门嵌入 YouTube 视频,使用 OBJECT 方法是否有任何优势,除了上述帖子中已经提到的那些?

考虑到如果 Flash 对查看器不可用,IFRAME 将回退到 HTML5,为什么有人想再使用 OBJECT 方法呢?

大卫。

4

1 回答 1

6

The <object> embed has a few differences. If you're writing a flash application, you won't be able to embed an iframe. So using the swf will work for those environments. The API also only support IE8 and above due to be implemented with postMessage. If you are just embedding the video the <iframe> will work great, but if you want access to the API your users will have to have IE8 or above.

The <iframe> is the supported and preferred method to use by YouTube. In addition to what already mentioned about the ability to get HTML5 playback (which is the biggest advantage), the API is richer and consistent with our other embedable content.

于 2012-11-01T14:19:06.303 回答