OBJECT vs IFRAME video embeds
Asked Answered
E

1

8

The question has already been asked as to whether OBJECT or IFRAME should be used for video embedding...

Should I use <object> or <iframe> for loading a video?

But my question takes that a step further. If specifically embedding YouTube videos, is there any advantage to using the OBJECT method, except for those already mentioned in the aforementioned post?

Bearing in mind that the IFRAME will fall back to HTML5 if Flash is unavailable to the viewer, why would anyone want to use the OBJECT method anymore?

David.

Equimolecular answered 1/11, 2012 at 13:59 Comment(0)
A
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.

Amoebic answered 1/11, 2012 at 14:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.