php音频和视频播放器代码函数

作者:笨小孩 发布于:2012-10-18 16:17 分类:PHP

/**
*
* 加载播放器
* @param $flag =1音频 =2视频
* @param $url 播放文件地址
* @param $width 播放器宽度
* @param $height 播放器高度
* 笨小孩 20120616 15:22
*/

function getplayer($flag, $url, $width, $height){
$playerhtml = ”;
if($flag == 1){
$playerhtml = ‘
<object width=”‘.$width.’” height=”‘.$height.’” classid=”clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6″>
<param value=”0″ name=”invokeURLs”><param value=”0″ name=”autostart”>
<param value=”‘.$url.’” name=”url”>
<embed width=”400″ height=”64″ type=”application/x-mplayer2″ autostart=”0″ src=”‘.$url.’”>
</object>
‘;
}elseif($flag == 2){
$playerhtml = ‘
<embed src=”‘.$url.’” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” wmode=”opaque” width=”‘.$width.’” height=”‘.$height.’”></embed>
‘;
}

return $playerhtml;
}

标签: 函数

发表评论:

手机版 | 
Copyright © 2012 lamp46.com All Right Reserved. sitemap