Aug 02

If you are looking to embed a YouTube video on your website, there’s one important step you must take so it plays properly on the iPhone and iPad.

Quick Background:  Because Steve Jobs hates Flash, and most web videos were originally encoded in Flash, many web videos won’t play on Apple’s iOS devices, which means the iPhone and iPad.  Fortunately the YouTube player on these devices can detect a Flash video and play it automagically.  But only if you use the correct embed code.

Share

To embed a YouTube video, click the Share button on the left beneath the video on the YouTube.com website:

Video on YouTube.com with Share button below

Embed

A panel appears with the video’s link.  Click the Embed button on the bottom left:

Click the Embed button

Embed Code

A text box opens with the embedding code.  But by default (as of this writing) this code uses <iframe> and will not show on the iPhone and iPad.  Users may hear the video but won’t see it.  Or nothing will happen at all.

Default embed code uses <iframe> that doesn't work on iPhone/iPad

One Important Step

But you can easily solve this problem in the options below the embed code.  And since YouTube remembers your options, make this change just once, and you will always receive the correct code in the future. 

Important Step:  Check the Use old embed code box at the bottom of the options list, as shown:

Use embed options to embed old <object> code, which works great on iPhone/iPad

The old embed code uses <object>, which works perfectly on the iPhone and iPad.  The YouTube player detects the code, pops up, goes full screen, and plays the Flash video:

iPhone screen capture. YouTube player showing video "Harrison Ford is still angry with Chewbacca"

Note the information in this article and the YouTube screens are correct as of this writing, but websites are subject to change frequently.  Here’s a good video that goes into more detail about properly embedding Vimeo and YouTube videos.

VVOTD

Speaking of videos, if you will indulge a shameless plug, please check out my new website VVOTD.com — Viral Video of the Day and follow me on Twitter.  Thanks!

Following is my favorite video so far, and it will warm your heart and make your day.  If you have 8 minutes and want to see a selfless act of human kindness, followed by an incredible show of grace and thanks by a giant of the sea, check out this video:

Humpback Puts on Whale of a Show for Men Who Saved Her

VVOTD - Humpback Puts on Whale of a Show for Men Who Saved Her

Article published on August 2, 2011




Leave a Reply