0
在我的網站上,我嘗試顯示一些youtube視頻。在數據庫中,我有YouTube視頻上的地址,我正在嘗試在我的網站上顯示它。問題是,當平板電腦訪問網站時,此代碼不起作用。嵌入式youtube視頻不能在Android上播放
我不知道爲什麼,也不知道如何調試問題。
<?php
// url of video
$url = $data['video'];
// we get the unique video id from the url by matching the pattern
preg_match("/v=([^&]+)/i", $url, $matches);
$id = $matches[1];
// template for generating embed codes
$code = '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/{id}&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/{id}&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>';
// replace each {id} with the actual ID of the video to get embed code
$code = str_replace('{id}', $id, $code);
if(isset($id)&& $id !== '') {
echo $code;
}
?>
你能幫助我做一些指點?
'TYPE =「應用程序/ x - 衝擊波閃光」'。 Flash在移動設備上無用。很少有人支持它,甚至更少的人甚至安裝它。 – 2013-02-24 20:59:06