Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » Youtube Module / Widget not working

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1709 Views
  • lazerscience
    Avatar
    Community Member
    16 Posts

    Youtube Module / Widget not working Link to this post

    Hi,
    I have installed the youtube module, but it doesnt display me any videos. I have tracked the problem down to the line

    $results->push(new ArrayData($data));


    in YoutubeService / getVideosFeed()! $data looks ok to me, also the transformation via new ArrayData.... seems to work, but result stays empty!
    Any fast help is appreciated!

  • lazerscience
    Avatar
    Community Member
    16 Posts

    Re: Youtube Module / Widget not working Link to this post

    Could figure it out now. The spelling was somehow a little bit different in YoutubeWidget.php than in YoutubeService.php!
    Change YoutubeWidget.php to

       foreach($videos as $video) {
             $videoId = array_pop(explode("/", $video->id));   
             
             $output->push(new ArrayData(array(
                "Title" => $video->Title,
                "Link" => $video->PlayerURL,
                "Image" => $video->SmallThumbnail->URL,
                "Duration" => $video->RuntimeMin
             )));
             
          }

    and you have it working again!

    1709 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.