1
這裏是我的代碼:在Firefox中WEBM不支持,但在Chrome相同WEBM支持
<?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它顯示undefined當我螢火蟲它和視頻失敗喲發揮。
不,但是當我手動添加代碼ir