WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: ad_acc on October 04, 2010, 10:55:13 PM

Title: YouTube Droplet Issue
Post by: ad_acc on October 04, 2010, 10:55:13 PM
Hi there!

I am trying to use the YouTube droplet to add videos to my site. The droplet seems to work fine if I only have one video on a page. However if, for example, I add 3 different YouTube videos on a page, the droplet uses the first video 3 times. I'm not sure if the droplet isn't working properly or if I'm doing something wrong. This is how I'm adding videos to my page:

[[youtube?id=VIDEO1]]
[[youtube?id=VIDEO2]]
[[youtube?id=VIDEO3]]

You can find the droplet details here:

http://www.websitebakers.com/pages/droplets/official-library/images/youtube.php (http://www.websitebakers.com/pages/droplets/official-library/images/youtube.php)

I noticed this issue brought up once in an old post but couldn't find a solution. Does anyone have any ideas? Any help would be greatly appreciated.

Thanks!

Title: Re: YouTube Droplet Issue
Post by: DarkViper on October 05, 2010, 12:13:55 AM
which version of droplet module you have in use?
Title: Re: YouTube Droplet Issue
Post by: ad_acc on October 05, 2010, 03:29:04 PM
I installed it just the other day so I assume its the latest version.
Title: Re: YouTube Droplet Issue
Post by: ad_acc on October 05, 2010, 03:31:24 PM
Here is the code I'm using for the droplet:

Code: [Select]
if (!$height) $height=344;
if (!$width) $width=425;
$returnvalue = '<object height="'.$height.'" width="'.$width.'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">';
$returnvalue .= '<param name="wmode" value="transparent" />';
$returnvalue .= '<param name="src" value="http://www.youtube.com/v/'.$id.'&rel=1" /><embed height="'.$height.'" width="'.$width.'" src="http://www.youtube.com/v/'.$id.'&rel=1" wmode="transparent" type="application/x-shockwave-flash"></embed></object>';
return $returnvalue;
Title: Re: YouTube Droplet Issue
Post by: ad_acc on October 14, 2010, 03:25:29 PM
Does anyone have any ideas?  :oops:

I can really use some help on this one...
Title: Re: YouTube Droplet Issue
Post by: dbs on October 14, 2010, 03:37:41 PM
check your droplet-version:
http://www.websitebakers.com/pages/droplets/module-wb2.8.php (http://www.websitebakers.com/pages/droplets/module-wb2.8.php)
Title: Re: YouTube Droplet Issue
Post by: ad_acc on October 14, 2010, 03:50:41 PM
Fantastic! That seems to have done the trick. Thanks so much for your help!
Title: Re: YouTube Droplet Issue
Post by: jonathansross on March 09, 2011, 04:41:37 AM
I have a new droplet based upon youtube's new iframe code. Try this:

Code: [Select]
if (!$H) $H=300;
if (!$W) $W=500;
return'
<iframe title="YouTube video player" height="'.$H.'" width="'.$W.'" src="http://www.youtube.com/embed/'.$YOUTUBEID.'" frameborder="0" allowfullscreen></iframe>
';

Usage:
[[yt-embed2?YOUTUBEID=HtJc9xKn8cY&H=400&W=600]]
-- or you can use it without the variables --
[[yt-embed2?YOUTUBEID=Y_hQORwUMn4]]

Let me know if it works for you.

Jonathan