You are here

function _video_apiclient_youtube_get_thumbnail_url in Video 6.2

Same name and namespace in other branches
  1. 5 types/video_youtube/video_youtube.module \_video_apiclient_youtube_get_thumbnail_url()
  2. 6 types/video_youtube/video_youtube.module \_video_apiclient_youtube_get_thumbnail_url()

returns the external url for a thumbnail of a specific video

Parameters

$id: the youtube id of the specific video @return a URL pointing to the thumbnail

File

types/video_youtube/video_youtube.module, line 199
Enable Youtube support for video module.

Code

function _video_apiclient_youtube_get_thumbnail_url($id) {
  $video_entry = _video_apiclient_youtube_video_entry($id);

  //  echo "Thumbnails:\n";
  $video_thumbnails = $video_entry
    ->getVideoThumbnails();
  foreach ($video_thumbnails as $video_thumbnail) {

    //echo $videoThumbnail['time'] . ' - ' . $videoThumbnail['url'];

    //echo ' height=' . $videoThumbnail['height'];

    //echo ' width=' . $videoThumbnail['width'] . "\n";
  }

  //exit;
  return $video_thumbnail['url'];
}