You are here

function _video_apiclient_youtube_video_entry in Video 6.2

2 calls to _video_apiclient_youtube_video_entry()
video_youtube_v_auto_playtime in types/video_youtube/video_youtube.module
Implementation of hook_v_auto_playtime
_video_apiclient_youtube_get_thumbnail_url in types/video_youtube/video_youtube.module
returns the external url for a thumbnail of a specific video

File

includes/apiclient.inc, line 108
Some functions for using video hosting providers api (Youtube, Google Video, etc..) Part of this code has been inspired by the video_cck module and adapted for the video module by jyamada1

Code

function _video_apiclient_youtube_video_entry($id, $cacheable = TRUE) {
  return TRUE;

  //_video_apiclient_youtube_init('youtube');

  // Get new http authentication.

  //$http_client = _video_upload_gdata_authenticate_youtube();

  //initialize Gdata lib
  $yt = _video_apiclient_youtube_gdata($http_client);

  //$yt = new Zend_Gdata_YouTube($http_client);

  // set API version

  //$yt->setMajorProtocolVersion(2);

  // if it's a cachable request, try to load a cached value
  //  if ($cacheable) {
  //    if ($cache = cache_get($id, 'cache')) {
  //      return unserialize($cache->data);
  //    }
  //  }
  try {

    //get video entried
    $videoEntry = $yt
      ->getVideoEntry($id);
    watchdog('youtube_video', $videoEntry
      ->getVideoDuration() . $videoEntry
      ->getVideoId() . $videoEntry
      ->getVideoTitle());

    //    print_r($videoEntry);
    //    exit;
  } catch (Zend_Gdata_App_HttpException $e) {
    watchdog('youtube_video', 'Authentication error while receiving YouTube connection object: %error', array(
      '%error' => $e
        ->getMessage(),
    ), WATCHDOG_ERROR);
  }

  // save a cacheable result for future use
  //  if ($cacheable) {
  //    cache_set($id, serialize($videoEntry), 'cache', time() + 3600);
  //  }
  return $videoEntry;
}