Why Should I Use IFrame Rather than Object Embeded Code?

Embedding a video into your website used to be challenging. Now, you can embed a YouTube video on your site just as easy as cutting and pasting. In order to make a video appear on your website, you can use either IFrame or Object embed code.

Although there are two types of embed code, IFrame embeds are recommended for embedding YouTube videos on websites. The reason why you should use IFrame over Object embed code is because IFrame will select the appropriate player based on the user’s capabilities. For example, videos embedded with IFrame will play on the latest player and can be viewed on browsers that support HTML5 and Flash, but a video embedded with Object code plays only on a flash player that mobile devices have problems playing.

When you use IFrame embed code, YouTube will automatically check the capability of the browser and will play the video accordingly. Videos embedded with IFrame code can be seen on mobile phones, making your videos viewable to clients using iPhones and other smartphones. For this reason, we overwhelmingly recommend using IFrame embed code over object embed code.