how to pull the video from RSS feed xml file?

lillioputty

New Member
I can show all the information including images from an RSS feed xml into my own php page. but I just found an interesting XML RSS feed which has video's in it and i want to show those videos in my own page!i use simplexml_load_file in order to pull the required information into my page.here is my code:\[code\]<?php$rss = simplexml_load_file('http://www.fifa.com/rss/index.xml');$limit = 1; // Change this number to however many items you want to display$counter = 1;if($rss){$items = $rss->channel->item;}foreach ($rss->channel->item as $item) { if($counter <= $limit) { echo "<div style='border: solid #39F 2px; width:300px; height:200px;'><img src=http://stackoverflow.com/"" . (string)$item->enclosure['url'][0] . "\" style='width:300px; height:200px;'></div>"; echo "<p>" . $item->pubDate . "</p>"; $counter++; }} ?>\[/code\]and here is the RSS feed XML file structure with the videos in:\[code\]<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel xmlns:media="http://search.yahoo.com/mrss/"><title>Uefa.com mrss video feed</title><link>http://www.uefa.com</link><description>Uefa.com mrss video feed</description><item><title>Sweden reaps HatTrick benefits</title><link>http://www.uefa.com/news/newsid=1685443.html?rss=1685443+Sweden+reaps+HatTrick+benefits&autoplay=true</link><description>How the UEFA HatTrick scheme has helped build new stadia and training facilities in Sweden.</description><pubDate>Wed, 21 Mar 2012 08:16:00 GMT</pubDate><media:content url="http://www.uefa.com/applets/videoplayer/embedded/UefaComPlayer.swf?c=/applets/videoplayer/config/video/videoconfigEmbedded.xml&lang=en&newsid=1685443&path=/NEWS/01\68\54\43\&autoplay=true" height="512" width="316" medium="video" expression="full" lang="en" /><media:copyright url="http://www.uefa.com/uefa/termsconditions.html">\[/code\]you can also view the XML RSS feed HERE: http://www.uefa.com/rssfeed/trainingground/grassroots/media.xmlany help would be appreciated.Thanks
 
Back
Top