You are here

function emvideo_bliptv_rss in Embedded Media Field 6

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 emvideo_PROVIDER_rss.

File

contrib/emvideo/providers/bliptv.inc, line 246
This include processes blip.tv media files for use by emfield.module.

Code

function emvideo_bliptv_rss($item, $teaser = NULL) {
  if ($item['value']) {
    if ($item['data']['emvideo_bliptv_data_version'] >= 1) {
      $data = $item['data'];
    }
    else {
      $data = emvideo_bliptv_data(NULL, $item);
    }

    // get the preferred type for the rss feed
    $var = 'emvideo_bliptv_rss_tag';
    $video_info = _emvideo_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 = 'emvideo_bliptv_rss_format';
      $video_info = _emvideo_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;
    }
  }
}