You are here

public function MediaInternetYouTubeHandler::getMRSS in Media: YouTube 7

Returns information about the media. See http://video.search.yahoo.com/mrss.

@todo Would be better for the return value to be an array rather than a SimpleXML element, but media_retrieve_xml() needs to be upgraded to handle namespaces first.

Return value

If ATOM+MRSS information is available, a SimpleXML element containing ATOM and MRSS elements, as per those respective specifications.

File

includes/MediaInternetYouTubeHandler.inc, line 65

Class

MediaInternetYouTubeHandler
Implementation of MediaInternetBaseHandler.

Code

public function getMRSS() {
  $uri = $this
    ->parse($this->embedCode);
  $video_id = arg(1, file_uri_target($uri));
  $rss_url = url('http://gdata.youtube.com/feeds/api/videos/' . $video_id, array(
    'query' => array(
      'v' => '2',
    ),
  ));

  // @todo Use media_retrieve_xml() once it's upgraded to include elements
  //   from all namespaces, not just the document default namespace.
  $entry = simplexml_load_file($rss_url);
  return $entry;
}