title: How do I put media:thumbnail in RSS feed
body: <p>I can't get the thumbnail images to display in the RSS feed items. Where do I put the code for the image to so up?</p>
  
  <p>first tried the getElementsByTagName but of course that doesn't work, then I tried your solution- $item_img = $item->getElementsByTagNameNS('the namespace URI you found','thumbnail')
                   ->item(0)->getAttribute('url'); 
  But that brought back an error that broke the whole page. I think I understand that thumbnail is a sub element of media: and I see that it is part of jwplayer:feedid under media:group. So, does it go in the array like the other items? I tried it inside the array and outside as well. Where do I put it to display the thumbnail in my newsfeed item?</p>
  
  <pre><code>&lt;?php
  $rss = new DOMDocument();
  $rss-&gt;load('https://cdn.jwplayer.com/v2/playlists/IYxiCISJ?format=mrss');
  $feed = array();
  foreach ($rss-&gt;getElementsByTagName('item') as $node) {
      $item = array ( 
          'title' =&gt; $node-&gt;getElementsByTagName('title')-&gt;item(0)-&gt;nodeValue,
          'desc' =&gt; $node-&gt;getElementsByTagName('description')-&gt;item(0)-&gt;nodeValue,
          'link' =&gt; $node-&gt;getElementsByTagName('link')-&gt;item(0)-&gt;nodeValue,
          'date' =&gt; $node-&gt;getElementsByTagName('pubDate')-&gt;item(0)-&gt;nodeValue,
  
          );
  
      array_push($feed, $item);
  }
  $limit = 5;
  for($x=0;$x&lt;$limit;$x++) {
      $title = str_replace(' &amp; ', ' &amp;amp; ', $feed[$x]['title']);
      $link = $feed[$x]['link'];
      $description = $feed[$x]['desc'];
      $date = date('l F d, Y', strtotime($feed[$x]['date']));
      echo '&lt;p&gt;&lt;strong&gt;&lt;a href="'.$link.'" title="'.$title.'"&gt;'.$title.'&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;';
      echo '&lt;small&gt;&lt;em&gt;Posted on '.$date.'&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;';
      echo '&lt;p&gt;'.$description.'&lt;/p&gt;';
  }
  </code></pre>
  
  <p>Here is the xml file output I am trying to parse:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/" xmlns:jwplayer="http://rss.jwpcdn.com/"&gt;
  &lt;channel&gt;
    &lt;title&gt;Car Repairs&lt;/title&gt;
    &lt;description&gt;Car Repairs&lt;/description&gt;
    &lt;jwplayer:kind&gt;MANUAL&lt;/jwplayer:kind&gt;
    &lt;jwplayer:feedid&gt;IYxiCISJ&lt;/jwplayer:feedid&gt;
    &lt;jwplayer:feed_instance_id&gt;7beba58b-b2a2-4000-af11-1e43a7cb8680&lt;/jwplayer:feed_instance_id&gt;
    &lt;jwplayer:link rel="first" href="https://cdn.jwplayer.com/v2/playlists/IYxiCISJ?format=mrss&amp;amp;page_offset=1&amp;amp;page_limit=500"/&gt;
    &lt;jwplayer:link rel="last" href="https://cdn.jwplayer.com/v2/playlists/IYxiCISJ?format=mrss&amp;amp;page_offset=1&amp;amp;page_limit=500"/&gt;
    &lt;item&gt;
      &lt;title&gt;Preparing the Audi A8 for Service- The American Garage&lt;/title&gt;
      &lt;link&gt;https://cdn.jwplayer.com/previews/ybcuKyZl&lt;/link&gt;
      &lt;description&gt;Putting Audi A8 in service mode.&lt;/description&gt;
      &lt;pubDate&gt;Mon, 17 Sep 2018 14:35:11 -0000&lt;/pubDate&gt;
      &lt;guid isPermaLink="false"&gt;ybcuKyZl&lt;/guid&gt;
      &lt;enclosure url="https://cdn.jwplayer.com/videos/ybcuKyZl-qQFQ3TOZ.mp4" type="video/mp4" length="515"/&gt;
      &lt;jwplayer:feedid&gt;IYxiCISJ&lt;/jwplayer:feedid&gt;
        &lt;media:group&gt;
        &lt;media:content url="https://cdn.jwplayer.com/manifests/ybcuKyZl.m3u8" medium="video" type="application/vnd.apple.mpegurl" duration="515"/&gt;
        &lt;media:content url="https://cdn.jwplayer.com/videos/ybcuKyZl-jTncGIBU.mp4" medium="video" type="video/mp4" duration="515" width="320" height="180" fileSize="19714361"/&gt;
        &lt;media:content url="https://cdn.jwplayer.com/videos/ybcuKyZl-i4o7KXqD.mp4" medium="video" type="video/mp4" duration="515" width="480" height="270" fileSize="29378682"/&gt;
        &lt;media:content url="https://cdn.jwplayer.com/videos/ybcuKyZl-XMc5nvLA.mp4" medium="video" type="video/mp4" duration="515" width="720" height="406" fileSize="40249178"/&gt;
        &lt;media:content url="https://cdn.jwplayer.com/videos/ybcuKyZl-qQFQ3TOZ.mp4" medium="video" type="video/mp4" duration="515" width="1280" height="720" fileSize="109187664"/&gt;
        &lt;media:content url="https://cdn.jwplayer.com/videos/ybcuKyZl-MTvbpSOY.m4a" medium="video" type="audio/mp4" duration="515" fileSize="7304077"/&gt;
        &lt;media:thumbnail url="https://cdn.jwplayer.com/thumbs/ybcuKyZl-720.jpg" width="720" /&gt;
        &lt;media:keywords&gt;The American Garage,thermostat,timing belt audi,audi a8,audi 4.2,water pump,service mode,A8,audi,car repairs&lt;/media:keywords&gt;
      &lt;/media:group&gt;
      &lt;jwplayer:track file="https://cdn.jwplayer.com/strips/ybcuKyZl-120.vtt" kind="thumbnails"/&gt;
    &lt;/item&gt;
  &lt;/channel&gt;
  &lt;/rss&gt;
  </code></pre>