博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
万能播放器代码
阅读量:5977 次
发布时间:2019-06-20

本文共 4826 字,大约阅读时间需要 16 分钟。

<script language=
"javascript"
>
var
LINK =
new
Array(
"{1}"
,
"提示:您播放的地址是否正确?"
);
var
linkType =
new
Array();
linkType[
'WMA'
] =
'WMP'
;
linkType[
'MP3'
] =
'WMP'
;
 
linkType[
'WMV'
] =
'WMP'
;
linkType[
'ASF'
] =
'WMP'
;
linkType[
'MPG'
] =
'WMP'
;
linkType[
'MPEG'
] =
'WMP'
;
linkType[
'AVI'
] =
'WMP'
;
linkType[
'ASX'
] =
'WMP'
;
 
linkType[
'RM'
] =
'Real'
;
linkType[
'RMVB'
] =
'Real'
;
linkType[
'RAM'
] =
'Real'
;
linkType[
'RA'
] =
'Real'
;
 
linkType[
'SWF'
] =
'Flash'
;
 
linkType[
'FLV'
] =
'Flv'
;
 
var
sufFix = LINK[0].substring(LINK[0].lastIndexOf(
"."
)+1,LINK[0].length).toUpperCase();
if
(sufFix.indexOf(
"#"
)) sufFix = sufFix.split(
"#"
)[0];
if
(sufFix.indexOf(
"?"
)) sufFix = sufFix.split(
"?"
)[0];
 
function
WMP(){
document.writeln(
"<object id='mediaplayer' width='480' height="
+((sufFix==
"MP3"
||sufFix==
"WMA"
)?
"64"
:
"360"
)+
" classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' align='center' border='0' type='application/x-oleobject' standby='Loading Windows Media Player components...'>"
);
document.writeln(
"<param name='url' value='"
+LINK[0]+
"'>"
);
document.writeln(
"<param name='AutoStart' value='1'><param name='Balance' value='0'><param name='enabled' value='-1'><param name='EnableContextMenu' value='0'><param name='PlayCount' value='1'><param name='rate' value='1'><param name='currentPosition' value='0'><param name='currentMarker' value='0'><param name='defaultFrame' value=''><param name='invokeURLs' value='-1'><param name='baseURL' value=''><param name='stretchToFit' value='0'><param name='volume' value='100'><param name='mute' value='0'><param name='uiMode' value='full'><param name='windowlessVideo' value='0'><param name='fullScreen' value='0'><param name='enableErrorDialogs' value='0'><param name='SAMIStyle' value=''><param name='SAMILang' value=''><param name='SAMIFilename' value=''><param name='captioningID' value=''>"
);
document.writeln(
"</object>"
);
 
document.close();
}
function
Real(){
document.writeln(
"<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width='480' height='300'  id='amourReal'>"
);
document.writeln(
"  <param name='src' value='"
+LINK[0]+
"'>"
);
document.writeln(
"  <param name='autostart' value='true'>"
);
document.writeln(
"  <param name='controls' value='imagewindow'>"
);
document.writeln(
"  <param name='console' value='clip1'>"
);
document.writeln(
"  <embed src='"
+LINK[0]+
"' width='480' height='300' type='audio/x-pn-realaudio-plugin' autostart='true' controls='imagewindow' console='video'>"
);
document.writeln(
"  </embed>"
);
document.writeln(
"</object>"
);
document.writeln(
"<br />"
);
document.writeln(
"<object classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width='480' height='60' id='amourReal'>"
);
document.writeln(
"  <param name='src' value='"
+LINK[0]+
"'>"
);
document.writeln(
"  <param name='autostart' value='true'>"
);
document.writeln(
"  <param name='controls' value='all'>"
);
document.writeln(
"  <param name='console' value='clip1'>"
);
document.writeln(
"  <embed type='audio/x-pn-realaudio-plugin' src='"
+LINK[0]+
"' width='480' height='60' autostart='true' controls='all' console='video'>"
);
document.writeln(
"  </embed>"
);
document.writeln(
"</object>"
);
 
document.close();
}
function
Flash(){
document.write(
"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='480' height='360'>"
);
document.write(
"<param name='movie' value='"
+LINK[0]+
"'>"
);
document.write(
"<param name='quality' value='high'>"
);
document.write(
"<embed src='"
+LINK[0]+
"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='480' height='360'></embed>"
);
document.write(
"</object>"
);
 
document.close();
}
function
Flv(){
document.writeln(
"<object classid=\'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\' codebase=\'http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,29,0\' width=\'480\' height=\'360\'>"
);
document.writeln(
"<param name=\'movie\' value=\'images\/play\/play_20071210.swf\'>"
);
document.writeln(
"<param name=\'quality\' value=\'high\'>"
);
document.writeln(
"<param name=\'allowFullScreen\' value=\'true\' \/>"
);
document.writeln(
"<param name=\'FlashVars\' value=\'vcastr_file="
+LINK[0]+
"&IsAutoPlay=0&DefaultVolume=100&BarPosition=1&IsShowBar=1&BarColor=0xFFFFFF&BarTransparent=50&GlowColor=0xFFFFFF&IconColor=0xFFFFFF&TextColor=0xFFFFFF&LogoUrl=/images\/play_logo.png&IsShowTime=1&BufferTime=2\' \/>"
);
document.writeln(
"<\/object>"
);
document.close();
}
 
function
Default(){
document.writeln(
"<a href='"
+ LINK[0] +
"' target='_blank'>"
+ LINK[1] +
"</a>"
);
document.close();
}
 
if
(linkType[sufFix]){
eval(linkType[sufFix]+
"()"
);
}
else
{
Default();
}
</script>

转载地址:http://gtsox.baihongyu.com/

你可能感兴趣的文章
Java 9 CompletableFuture 进化小脚步
查看>>
【前端词典】进阶必备的网络基础(下)
查看>>
ARTS训练第三周
查看>>
12月21日云栖精选夜读:阿里云总裁胡晓明:AI泡沫过后,下一站是“产业AI”...
查看>>
一出好戏不止是部电影,它也正接近你的生活。
查看>>
Angular 表单验证类库 ngx-validator 1.0 正式发布
查看>>
刨根问底——Handler
查看>>
H5活动刮刮卡功能的实现与注意事项
查看>>
搞定Go单元测试(三)—— 断言(testify)
查看>>
web前端—面试2
查看>>
设计模式之 - 简单工厂模式
查看>>
前端如何搭建一个成熟的脚手架
查看>>
vue中v-for循环如何将变量带入class的属性名中
查看>>
PHP 安全问题入门:10 个常见安全问题 + 实例讲解
查看>>
Leetcode03
查看>>
Mysql常用命令
查看>>
Vuex的基本使用
查看>>
在DigitalOcean玩Kubernetes(K8S)
查看>>
双机概念
查看>>
#我要10000+# 计划启动啦!让文章拥有更多曝光~
查看>>