这是我的代码:
<?php
/**
* @author Arpit
* @copyright 2012
*/
$crxml=file_get_contents('latest.xml');
$rss=new SimpleXMLElement($crxml);
$playlistitem=1;
foreach($rss->channel->item as $post)
{
if($playlistitem<=8)
{
echo '<ul>';
echo '<li class="xdesc">'.$post->description.'</li>';
$dc=$post->children('http://search.yahoo.com/mrss/');
echo '<li class="xthumb">'.$dc->thumbnail->attributes()->url.'</li>';
echo '<li class="xpreview">'.$dc->thumbnail->attributes()->url.'</li>';
echo '<li class="xsources_mp4">'.$dc->content->attributes()->url.'</li>';
$dc->content->attributes()->url=preg_replace('/.mp4/','.webm',$dc->content->attributes()->url);
echo '<li class="xsources_webm">'.$dc->content->attributes()->url.'</li>';
echo '</ul>';
$playlistitem++;
}
}
?>
当我在xsources_mp4和xsource_webm中将扩展名更改为webm时,它再次在chrome中工作但在Firefox中它显示未定义当我Firebug它并且视频无法播放时。