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.

All other Modules

Discuss all other Modules here.

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

Youtube Module / Widget not working


Reply

2 Posts   1727 Views

Avatar
lazerscience

13 August 2009 at 9:56pm Community Member, 16 Posts

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!

Avatar
lazerscience

14 August 2009 at 3:48am Community Member, 16 Posts

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!