dreasgrech / youtube-collage

Builds a collage of YouTube videos
http://www.dreasgrech.com/upload/youtubecollage/
1 stars 0 forks source link

Modal dialog won't contain the video if the browser doesn't have Flash #37

Open dreasgrech opened 12 years ago

dreasgrech commented 12 years ago

Since the YouTube embed is a Flash object, browsers such as (most) mobile browsers won't be able to see the YouTube embed in the modal dialog after clicking on a video thumbnail.

There is a way how to embed videos using HTML5 (IFRAME): http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html

Here's the IFRAME API: http://apiblog.youtube.com/2011/01/introducing-javascript-player-api-for.html

dreasgrech commented 12 years ago

swfobject.embedSWF(...) takes a callback and from it I can check if the embed was successful or not.

http://code.google.com/p/swfobject/wiki/api#swfobject.embedSWF%28swfUrlStr,_replaceElemIdStr,_widthStr,_height

dreasgrech commented 12 years ago

Alternatively, I can put a link that will open the YouTube video directly: https://developer.apple.com/library/safari/#featuredarticles/iPhoneURLScheme_Reference/Articles/YouTubeLinks.html#//apple_ref/doc/uid/TP40007895-SW1

dreasgrech commented 12 years ago

Hmm, this looks interesting: http://www.tikku.com/jquery-youtube-tubeplayer-plugin Note that this plugin requires swfobject as well.