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.

All other Modules /

Discuss all other Modules here.

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

Youtube Module / Widget not working


Go to End


2 Posts   2528 Views

Avatar
lazerscience

Community Member, 16 Posts

13 August 2009 at 9:56pm

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

Community Member, 16 Posts

14 August 2009 at 3:48am

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!