You are here

function video_embed_youku_handle_thumbnail in Video Embed Youku 7

Gets the thumbnail url for Youku videos.

Parameters

string $url: The video URL.

Return value

array The video thumbnail information.

1 string reference to 'video_embed_youku_handle_thumbnail'
video_embed_youku_video_embed_handler_info in ./video_embed_youku.module
Implements hook_video_embed_handler_info().

File

./video_embed_youku.module, line 120
Adds a handler for Youku videos to Video Embed Field.

Code

function video_embed_youku_handle_thumbnail($url) {
  $id = _video_embed_youku_get_video_id($url);
  $id = str_replace('.html', '', $id);
  $link = 'https://api.youku.com/videos/show.json?client_id=' . variable_get('video_embed_field_youku_client_id', '8d025b9c897b22a8') . '&video_id=' . $id;
  $http = drupal_http_request($link);
  $json = drupal_json_decode($http->data);
  return array(
    'id' => $json['id'],
    'url' => $json['bigThumbnail'],
  );
}