Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Youtube breaks out of site


Go to End


4 Posts   1770 Views

Avatar
Double0Seven

Community Member, 3 Posts

5 September 2008 at 5:58am

Hi,

I just love the youtube page, the only downside I find is that every link sends you directly to the youtube site.
Wouldn't is be possible to
1. Play the youtube movie inside thesilverstripe page itself. (best option)
2. make the link to a new page?

TX
Karsten

Avatar
grilldan

Community Member, 135 Posts

5 September 2008 at 9:11pm

Edited: 05/09/2008 9:12pm

Try changing line 75 in YoutubeGallery to:

			$outputHTML .=  '<li><div class="still"><a target="_blank" href="'.$video->player_url.'" title="'.htmlentities($video->title).'"><img src="'.$video->thumbnail_url.'" alt="'.htmlentities($video->title).'"/></a></div><div class="info"><h6><a target="_blank" href="'.$video->player_url.'" title="'.htmlentities($video->title).'">'.$video->title.'</a></h6><p>'.$video->description.'<br/><strong>Duration : </strong>'.$duration.'</p></div></li>';

Just added a target="_blank" to the a href.

Tested, and working.

Avatar
Double0Seven

Community Member, 3 Posts

21 September 2008 at 1:05am

I have found the solution - thanks for pointing me in the right direction.
I have managed to let it play inside your own page:
Modify the youtubegallery.php.
add the first line below with the str_replace line before the $outputHTML line
than replace the $outputHTML line as shown below.

$video->player_url = str_replace("watch?v=","/v/",$video->player_url);
$outputHTML .=  '<object width="425" height="344"><param name="movie" value="'.$video->player_url.'"></param><param name="allowFullScreen" value="true"></param><embed src="'.$video->player_url.'" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object><div class="info"><h6>'.$video->title.'</h6><p>'.$video->description.'<br/><strong>Duration : </strong>'.$duration.'</p></div>';

Thanks

Avatar
Double0Seven

Community Member, 3 Posts

21 September 2008 at 1:15am

And with full screen option :-D

.


$outputHTML .=  '<object width="425" height="344"><param name="movie" value="'.$video->player_url.'&hl=nl&fs=1&rel=0&color1=0x006699&color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><embed src="'.$video->player_url.'&hl=nl&fs=1&rel=0&color1=0x006699&color2=0x54abd6" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object><div class="info"><h6>'.$video->title.'</h6><p>'.$video->description.'<br/><strong>Duration : </strong>'.$duration.'</p></div>';


.