You are here

function youtube_build_thumbnail_uri in YouTube Field 7

Same name and namespace in other branches
  1. 8 youtube.module \youtube_build_thumbnail_uri()

Builds the URI to a given thumbnail or the module's thumbnail directory.

Parameters

string $video_id: (optional) The video ID to build the thumbnail URI for.

Return value

string If a $video_id was supplied, the URI to that video's thumbnail. Otherwise the URI to the module's thumbnail directory.

4 calls to youtube_build_thumbnail_uri()
theme_youtube_thumbnail in ./youtube.theme.inc
Theme function for thumbnails.
youtube_get_remote_image in ./youtube.inc
Retrieves the thumbnail image for a given video from YouTube.
youtube_thumb_delete_all in ./youtube.inc
Submit callback; delete all existing thumbnail image files.
youtube_tokens in ./youtube.inc
Implements hook_tokens().

File

./youtube.inc, line 110
YouTube field helper functions.

Code

function youtube_build_thumbnail_uri($video_id = NULL) {
  $scheme = file_default_scheme();
  $youtube_thumb_dir = variable_get('youtube_thumb_dir', 'youtube');
  $youtube_thumb_uri = $scheme . '://' . $youtube_thumb_dir;
  if ($video_id) {
    return $youtube_thumb_uri . '/' . $video_id . '.jpg';
  }
  return $youtube_thumb_uri;
}