Skip to content
Michael Haschke edited this page Jul 12, 2015 · 3 revisions

YouTube service class

The YouTube service shows liked and uploaded videos from a YouTube account. It is using the Google Youtube v3 API and provides aggregation of videos in a playlist. You need to get an public API key for server application, and activation of the Youtube v3 API is necessagry, both you can manage via the Google Developers Console.

Configuration values

  • username: username of the YouTube account, as in http://youtube.com/user/username
  • apikey: the public API key to use Google APIs
  • list: either one of uploads, favorites, likes, watchHistory, watchLater; or the list id directly, as in https://www.youtube.com/playlist?list=listid

... and the basic configuration for all services.

Example configuration

$youtube_videos = array(
    'Youtube', 'youtube_uploads', array(
        'list' => 'uploads',
        'username' => 'BeastieBoys',
        'apikey' => 'YOURAPIKEY',
        'total' => 3,
        'title' => 'Youtube',
        'description' => 'recent Beastie Boys videos'
    )
);

Template keys

  • title: the title of the video
  • description: description body of the video
  • date: publishing date
  • media_thumbnail_url: URL of smallest thumbnail
  • media_medium_url: URL of medium sized thumbnail
  • media_high_url: URL of bigger thumbnail
  • media_standard_url: URL of biggest preview images
  • videoid: id of the video, as in https://www.youtube.com/watch?v=videoid
  • link: URL of the Youtube video

A video don't provide always all thumbnail sizes.