jQuery Ceebox with YouTube playlist support

08 feb 2010


When I decided to use Ceebox, I made the choice based on how easy it was to you Youtube video in a lightbox. But as we all know, projects change while working on them. The biggest change I had to handle was not using single Youtube video's but Youtube playlists.

As soon as I posted an youtube playlist URL, I noticed that the lightbox loaded the page as an iFrame, meaning I didn't get the nice embedded video option.

I took a little look at the jQuery Ceebox plugin and noticed they had a neat solution for detecting the action. All I did was look at the difference between an video and playlist URL and added an option.

Youtube video URL
Youtube playlist URL
http://www.youtube.com/view_play_list?p= videocode

Added to jQuery Ceebox main JavaScript:
After line 125
youtubelist: {
siteRgx : /youtube\.com\/view_play_list/i,
idRgx: /(?:p=)([a-zA-Z0-9_\-]+)/i,
src : "http://www.youtube.com/p/[id]&hl=en&fs=1&autoplay=1"

For more information on Ceebox, click here.


Vergelijkbare berichten

comments powered by Disqus