You are here

function video_cck_bliptv_rss in Embedded Media Field 5

providers may supply an enclosure for rss feeds. this expects something in a file format, so would be an object in the format of $file->filepath, $file->filesize, and $file->filemime. calls the providers hook video_cck_PROVIDER_rss

File

contrib/video_cck/providers/bliptv.inc, line 192

Code

function video_cck_bliptv_rss($item, $teaser = NULL) {
  if ($item['value']) {
    if ($item['data']['video_cck_bliptv_data_version'] >= 1) {
      $data = $item['data'];
    }
    else {
      $data = video_cck_bliptv_data(NULL, $item);
    }

    // get the preferred type for the rss feed
    $var = 'video_cck_bliptv_rss_tag';
    $video_info = _video_cck_bliptv_get_video_info_from_preferred_tag($data, $var);

    // grab the preferred filetype rather than tag, so .mov rather than 'web'
    if ($video_info == 'override') {
      $var = 'video_cck_bliptv_rss_format';
      $video_info = _video_cck_bliptv_get_video_info_from_preferred_tag($data, $var);
    }

    // default to flv if there's no available clip format
    if (is_null($video_info) || $video_info == 'override' && $video_info != 'none') {
      $video_info = $data['flv'];
    }
    if (is_array($video_info)) {

      // Begin building file object.
      $file = array();

      // Create temporary name/path for newly uploaded files.
      $file['filepath'] = $video_info['url'];
      $file['filesize'] = $video_info['size'];
      $file['filemime'] = $video_info['mime'];

      // additional data for Y! MRSS
      $file['thumbnail']['filepath'] = $data['thumbnail']['url'];
      $file['width'] = $video_info['width'] ? $video_info['width'] : 0;
      $file['height'] = $video_info['height'] ? $video_info['height'] : 0;
      $file['duration'] = $video_info['duration'] ? $video_info['duration'] : FALSE;

      // @todo media:credit role="author" ...
      return $file;
    }
  }
}