• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

php播放器代码

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

播放器可以支持10几种的 视频格式~如果有高手或是美工可以自行的美化和修改加强一下使用.
把下面的PHP代码保存一下成player.php
然后上传到FTP中在 WEB上使用
http://www.abc.com/player.php?url=htttp://www.8le.net/test.wma
可以在 wma后面加上& 防止下载文件

 

 

player.php:::::::::::::

 

<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<style type="text/css"> 
td { 
         FONT-SIZE: 9pt; COLOR: #006600; FONT-FAMILY: "Arial", "Helvetica", "sans-serif"; TEXT-DECORATION: none; line-height:none; 

</style> 

<title>八乐音乐网(本站所有内容均来自于网络 仅做宽带测试研究之用 如有侵权 请与本站联系)</title> 
</head> 
<!------禁止鼠标和键盘以及CTR + N 开新窗口的JAVA-------> 
<script language=JavaScript> 
<!-- 
var message=""; 
/////////////////////////////////// 
function clickIE() {if (document.all) {(message);return false;}} 
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) { 
if (e.which==2||e.which==3) {(message);return false;}}} 
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 
document.oncontextmenu=new Function("return false") 
// --> 
</script> 


</head> 


<body topmargin="0" leftmargin="0" onkeydown=return(!(event.keyCode==78&&event.ctrlKey))> 
<TABLE cellSpacing=0 cellPadding=0 width=100% border=0 bgcolor=#cccccc><tr> 
<td bgcolor=#efefef height=3></td> 
</tr></table> 
<div align="center"> 
<?php 
/* 
if($_GET['url']!=''){ 
$mov_url=$_GET['url']; 
$mov_wigth=$_GET['w']; 
$mov_height=$_GET['h']; 
$mov_auto=$_GET['a']; 
$mov_player=$_GET['p']; 
*/ 
if($url!=''){ 
$mov_url=$url; 
$mov_player=$p; 
$mov_wigth=$w; 
$mov_height=$h; 
$mov_auto=$a; 
    $mov_file=basename($mov_url); 
    $mov_type=substr(strrchr($mov_file,'.'),1); 
    $mov_type=strtolower($mov_type); 
    if($mov_width==''){$mov_width=500;} 
    if($mov_height==''){$mov_height=450;} 
    if($mov_auto==''){$mov_auto=1;} 
    if($mov_player==''){$mov_player=0;} 
    $mov_player+=0; 
    if($mov_player==0 || $mov_player>3){ 
            if($mov_type=="mp3"||$mov_type=="m3u"||$mov_type=="wmv"||$mov_type=="wvx"||$mov_type=="mpg"||$mov_type=="mpeg"||$mov_type=="mpv"||$mov_type=="wax"||$mov_type=="asf"||$mov_type=="asx"||$mov_type=="wmx"||$mov_type=="wm"||$mov_type=="wma"){ 
?> 
<object id=nstv classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 width=<?=$mov_width?> height=<?=$mov_height?> codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701standby=Loading Microsoft? Windows Media? Player components... type=application/x-oleobject> 
<param name=URL value=<?=$mov_url?>> 
<PARAM NAME=UIMode value=full> 
<PARAM NAME=AutoStart value=<?=$mov_auto?>> 
<PARAM NAME=Enabled value=true> 
<PARAM NAME=enableContextMenu value=false> 
<param name=WindowlessVideo value=true> 
</object> 
<?php 
}elseif($mov_type=="swf"){ 
?> 
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH=<?=$mov_width?> HEIGHT=<?=$mov_height?>> 
<PARAM NAME=MOVIE VALUE=<?=$mov_url?>> 
<PARAM NAME=PLAY VALUE=TRUE> 
<PARAM NAME=LOOP VALUE=TRUE> 
<PARAM NAME=QUALITY VALUE=HIGH> 
<EMBED SRC=<?=$mov_url?> WIDTH=<?=$mov_width?> HEIGHT=<?=$mov_height?> PLAY=TRUE LOOP=TRUE QUALITY=HIGH> 
</EMBED> 
</OBJECT> 
<?php 
}else{ 
?> 
<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=<?=$mov_height?> id=video1 width=<?=$mov_width?> VIEWASTEXT> 
<param name=_ExtentX value=5503> 
<param name=_ExtentY value=1588> 
<param name=AUTOSTART value=<?=$mov_auto?>> 
<param name=SHUFFLE value=0> 
<param name=PREFETCH value=0> 
<param name=NOLABELS value=0> 
<param name=SRC value=<?=$mov_url?>> 
<param name=CONTROLS value=Imagewindow,ControlPanel> 
<param name=CONSOLE value=RAPLAYER> 
<param name=LOOP value=0> 
<param name=NUMLOOP value=0> 
<param name=CENTER value=0> 
<param name=MAINTAINASPECT value=0> 
<param name=BACKGROUNDCOLOR value=#000000> 
</OBJECT> 
<?php 
}} 
else if($mov_player==1){ 
?> 
<object id=nstv classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 width=<?=$mov_width?> height=<?=$mov_height?> codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701standby=Loading Microsoft? Windows Media? Player components... type=application/x-oleobject> 
<param name=URL value=<?=$mov_url?>> 
<PARAM NAME=UIMode value=full> 
<PARAM NAME=AutoStart value=<?=$mov_auto?>> 
<PARAM NAME=Enabled value=true> 
<PARAM NAME=enableContextMenu value=false> 
<param name=WindowlessVideo value=true> 
</object> 
<?php 

else if($mov_player==2){ 
?> 
<OBJECT classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=<?=$mov_height?> id=video1 width=<?=$mov_width?> VIEWASTEXT> 
<param name=_ExtentX value=5503> 
<param name=_ExtentY value=1588> 
<param name=AUTOSTART value=<?=$mov_auto?>> 
<param name=SHUFFLE value=0> 
<param name=PREFETCH value=0> 
<param name=NOLABELS value=0> 
<param name=SRC value=<?=$mov_url?>> 
<param name=CONTROLS value=Imagewindow,ControlPanel> 
<param name=CONSOLE value=RAPLAYER> 
<param name=LOOP value=0> 
<param name=NUMLOOP value=0> 
<param name=CENTER value=0> 
<param name=MAINTAINASPECT value=0> 
<param name=BACKGROUNDCOLOR value=#000000> 
</OBJECT> 
<?php 

else if($mov_player==3){ 
?> 
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" WIDTH=<?=$mov_width?> HEIGHT=<?=$mov_height?>> 
<PARAM NAME=MOVIE VALUE=<?=$mov_url?>> 
<PARAM NAME=PLAY VALUE=TRUE> 

<PARAM NAME=LOOP VALUE=TRUE> 
<PARAM NAME=QUALITY VALUE=HIGH> 
<EMBED SRC=<?=$mov_url?> WIDTH=<?=$mov_width?> HEIGHT=<?=$mov_height?> PLAY=TRUE LOOP=TRUE QUALITY=HIGH> 
</EMBED> 
</OBJECT> 
<?php 
}}else{echo "error!";} 
?> 
</table> 
</body> 
</html>


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
php执行sql语句打印结果发布时间:2022-07-10
下一篇:
PHP使用Kafka安装拾遗发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap