You are here

function emvideo_youtube_rss in Embedded Media Field 6

hook emfield_PROVIDER_rss

Embeds the video in the RSS feed.

File

contrib/emvideo/providers/youtube.inc, line 274
This include processes youtube.com media files for use by emfield.module.

Code

function emvideo_youtube_rss($item, $teaser = NULL) {
  if ($item['value']) {
    if (!empty($item['data']['emvideo_youtube_data_version']) && $item['data']['emvideo_youtube_data_version'] >= 1) {
      $data = $item['data'];
    }
    else {
      $data = emvideo_youtube_data(NULL, $item);
    }
    $file = array();
    if (is_array($data['flash'])) {
      $file['filepath'] = $data['flash']['url'];
      $file['filesize'] = $data['flash']['size'];
      $file['filemime'] = $data['flash']['mime'];
    }
    $file['thumbnail']['filepath'] = $data['thumbnail']['url'];
    return $file;
  }
}