Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Youtube breaks out of site

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

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

Page: 1
Go to End
Author Topic: 1303 Views
  • Double0Seven
    Avatar
    Community Member
    3 Posts

    Youtube breaks out of site Link to this post

    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

  • grilldan
    Avatar
    Community Member
    135 Posts

    Re: Youtube breaks out of site Link to this post

    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.

  • Double0Seven
    Avatar
    Community Member
    3 Posts

    Re: Youtube breaks out of site Link to this post

    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

  • Double0Seven
    Avatar
    Community Member
    3 Posts

    Re: Youtube breaks out of site Link to this post

    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>';

    .

    1303 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.