9

I am trying to find out as to why youtube embeds works just fine on iPad, and not the embeds of any other video site.

Example of youtube embed:

<object width="640" height="385">
        <param name="movie" value="http://www.youtube.com/v/DlIU5TgwEFg&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1"></param>
        <param name="allowFullScreen" value="true"></param>
        <param name="allowScriptAccess" value="always"></param>
        <embed src="http://www.youtube.com/v/DlIU5TgwEFg&color1=0xb1b1b1&color2=0xcfcfcf&hl=en_US&feature=player_embedded&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="385"></embed>
</object>

is this because iPad has got a native youtube app which has special support for youtube embeds, or is this something that is handled by the script that's get executed by the youtube embed code, which might check for the user agent, and then load the HTML5 video player with a source pointing to the h.264 encoded version of the video (is something of this sort possible)?

Nagaraj Hubli
  • 172
  • 1
  • 1
  • 6
  • what do you mean by `and not the embeds of any other video site.`? I have embedded Youtube videos on my site before and it works flawlessly. – Buhake Sindi Apr 05 '10 at 14:17
  • I mean, if you create a test page with the embed code of the Vimeo video for example, and try to open that in iPad, it doesn't play, but that's not the case with youtube embeds, they play just fine. – Nagaraj Hubli Apr 05 '10 at 14:23
  • I know that iPad has no flash support at all. I guess iPad only has youtube plugin (seeing that they partner a lot with Google). – Buhake Sindi Apr 05 '10 at 14:28
  • The answer lies here http://developer.apple.com/library/safari/#featuredarticles/iPhoneURLScheme_Reference/Articles/YouTubeLinks.html#//apple_ref/doc/uid/TP40007895-SW1 – Mark Cassidy May 03 '11 at 06:20

5 Answers5

18

Youtube links are handled specially in the iPhoneOS.

This is because there is a /System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin to handle these.

HTML5 is irrelevant here.

kennytm
  • 491,404
  • 99
  • 1,053
  • 989
  • Yes, but I think Vimeo is starting to allow HTML5 embedding. I think I saw something about it in this video: http://www.youtube.com/watch?v=dYYG8xsuW5w (hosted on YouTube, ironically) – Benjamin Oakes Jun 08 '10 at 14:35
2

The iPad does not support flash which your embed is. So... I'm guessing youtube is serving a video instead of a flash file in the case of an iPad/iPhone/iWhatever.

Wolph
  • 74,301
  • 10
  • 131
  • 146
  • Yeah, but they do this for normal embed codes as well. It's something in the iPad OS which replaces the embed tags for a video tag (so you can't replicate this for normal embeds to other sites..). – PanMan Apr 27 '10 at 11:52
1

YouTube has HTML 5 version (http://www.youtube.com/html5) and iPad doesn't support flash.

Jan Tojnar
  • 4,912
  • 3
  • 27
  • 44
1

You could use something like SWFObject to embed your video with a Flash player, and if it fails, replace that embed with an HTML5 video tag instead.

Matt Rix
  • 844
  • 7
  • 10
0

Latest Iframe embed code is working perfect on iphone.

Kashif Munir
  • 193
  • 1
  • 3
  • 19