RSS
热门关键字:  隐藏访问总人数  班级  足球  奥运会  篮球

最终 最强 最全 最明白的 校内网播放器代码问题回答贴

来源:www.xiaon.org.cn 作者:校内网 时间:2008-01-24 Tag: 点击:

如果你能使用好这些代码,你会发现那些所谓的播放器可以轻轻松松搞定,而且是自己打造的,颇有成就感。
一、单曲播放(背景音乐为一首)
这类代码有:
1、<BGSOUND balance=0 src=\"http://img.xiaonei.com/photos/20060603/1510/orig51097.wma\" volume=-240 loop=infinite><!--背景音乐-->
Volume表示音量,loop=infinite表示循环播放,不停止。这种代码是看不到播放器的。

2、<embed src=\"http://img.xiaonei.com/photos/20060603/1510/orig51097.wma\" hidden=\"true\" autostart=\"true\" loop=\"true\"><!--背景音乐-->
--------hidden=\"true\"表示隐藏播放,即不显示播放器的外观,若要想显示,把\"true\" 替换为\"false\"即可,这样为默认是最小化播放,若还想具体显示播放器的大小,另加上height=\"高度值\" width=\"宽度值\" 就可以了。
-------autostart=\"true\"表示当前页一载入则自动播放,若不希望播放改为autostart=\"false\"
即可...
------ loop=\"true\"表示无限次循环播放音乐直到当前页关闭为止,不想循环播放替换为 loop=\"false\"就OK了

3、<embed src=\"http://img.xiaonei.com/photos/20060603/1510/orig51097.wma\" autostart=\"true\" loop=\"-1\" controls=\"ControlPanel\" width=\"0\" height=\"0\" ><!--背景音乐-->
---------loop=\"-1\" 表示无限次循环播放,可设置播放次数,用具体数字代替即可,比如我希望它播放两次,则loop=\"2\"
--------controls=\"ControlPanel\"这个控制选项可省略
--------width=\"0\" height=\"0\"表示隐藏播放,和前面的一样。
若欲设置播放器的外观,则替换为具体的数值就可以了,比如width=\"123\" height=\"100\"

说明:上面的音乐网址都可自行修改,代码可以直接复制,建议将音乐上传到校内网上,这样加载速度快。

二、多首背景歌曲连播,有两种方法
1、使用M3u列表(只能播放Mp3格式的文件)
首先, 新建一个记事本文件(这个要是不会赶紧去学电脑...)
  第二、从网上搜索你喜欢的歌曲,取得网址(一定要是Mp3格式的,其他格式不行),把你找来的MP3地址一个一行排好,一行只能排一个,不得有空行。如:
http://vip.hanzify.org/carlchina/temp/HITFMjh.mp3
http://vip.hanzify.org/carlchina/temp/HITFMjh.mp3
http://vip.hanzify.org/carlchina/temp/HITFMjh.mp3
  就像这样,地址可以无限多,最少一个,然后保存,保存的文件名最好是英文或者数字。

  然后将记事本文件的扩展名.txt改为.M3U,系统会提示改扩展名会导致文件可能不可用,是否继续?点“是”,文件变为M3U了。你也可以将txt文件另存为.M3U格式。接着你可以打开试听一下效果,如果地址够快的话在你电脑本地就可以进行听歌了。
  最后,把这个M3U文件上传到校内网上,在上传好的文件里点属性,查看地址,将地址(一定是以M3u结尾的网址)贴进一下代码的音乐网址就可以了。
<EMBED src=http://www.xfuu.cn/code/5/2007/音乐网址 width=180 height=50 type=audio/mpeg autostart=\"true\" loop=\"true\">
参数可以自己设置,请参照一自己修改。
2、使用ASX列表(不限制音乐格式)
首先新建一个记事本文件,将以下代码输入:
<ASX version =\"3.0\">
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1720/orig55328.wma\"/>
</Entry>
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1640/orig46257.wma\"/>
</Entry>
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1710/orig52716.wma\"/>
</Entry>
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1720/orig55812.wma\"/>
</Entry>
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1730/orig57023.wma\"/>
</Entry>
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1730/orig57177.wma\"/>
</Entry>
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1640/orig46257.wma\"/>
</Entry>
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1730/orig58026.wma\"/>
</Entry>
<Entry>
<Ref href = \"http://img.xiaonei.com/photos/20061121/1740/orig58502.wma\"/>
</Entry>
</ASX>
然后另存为扩展名为.asx的文件,如music.asx。你可以打开一下试听。最后将此文件上传到校内网上,获取文件地址。
将下列代码加入涂鸦板即可:
<embed src=\"http://img.xiaonei.com/photos/20061121/1740/orig79888.asx\" autostart=\"true\" loop=\"-1\" controls=\"ControlPanel\" width=\"0\" height=\"0\" ><!--背景音乐-->
你也可以用上面介绍的方法自行设置参数。
  这种方法,简单、高速、占资源少,且可以播放mp3,wma,asx等多种格式,且不必担心有弹出式广告之类。
 

说明:上面介绍的两种方法均需要先上传好音乐。

三、多首歌曲随机播放,只播放一首,但刷新一次,播放一首不相同的歌曲

新建一个记事本文件,将以下代码输入:
<SCRIPT language=\"javascript\">
<!--

var sound1=\"http://img.xiaonei.com/photos/20061121/1640/orig46257.wma\"

var sound2=\"http://img.xiaonei.com/photos/20061121/1710/orig71630.wma\"

var sound3=\"http://img.xiaonei.com/photos/20061121/1720/orig55328.wma\"

var sound4=\"http://img.xiaonei.com/photos/20061121/1720/orig55812.wma\"

var sound5=\"http://img.xiaonei.com/photos/20061121/1730/orig57023.wma\"

var sound6=\"http://img.xiaonei.com/photos/20061121/1730/orig57177.wma\"

var sound7=\"http://img.xiaonei.com/photos/20061121/1640/orig46257.wma\"

var sound8=\"http://img.xiaonei.com/photos/20061121/1730/orig58026.wma\"

var sound9=\"http://img.xiaonei.com/photos/20061121/1740/orig58502.wma\"

var sound10=\"http://img.xiaonei.com/photos/20061121/1720/orig55328.wma\"

var x=Math.round(Math.random()*9)

if (x==0) x=sound1

else if (x==1) x=sound2

else if (x==2) x=sound3

else if (x==3) x=sound4

else if (x==4) x=sound5

else if (x==5) x=sound6

else if (x==6) x=sound7

else if (x==7) x=sound8

else if (x==8) x=sound9

else x=sound10

if (navigator.appName==\"Microsoft Internet Explorer\")

document.write('<bgsound src='http://www.xfuu.cn/code/5/2007/+'\"'+x+'\"'+' loop=\"infinite\">')

else

document.write('<embed src=http://www.xfuu.cn/code/5/2007/'+'\"'+x+'\"'+'hidden=\"true\" border=\"0\" width=\"20\" height=\"20\" autostart=\"true\" loop=\"true\">')



//-->
</SCRIPT>

将记事本文件另存为htm网页文件,然后上传到校内网上,获取地址。
在涂鸦板中输入以下代码
<div id=music><img src=http://www.xiaonw.com/html/2007-06/../../\"javasc ript:music.innerHTML='<ifr ame src=http://img.xiaonei.com/photos/20061121/2020/orig92674.htm height=0 marginwidth=0 marginheight=0 hspace=0 vspace=0 fr ameborder=0 scrolling=no></ifr ame>'\" style=display:none></div><!--背景音乐-->
中间的网址即是你上传的网页地址。
直接复制可能没用,请下载代码。见下面的地址。这种我觉得比较好,我目前用的就是这种。
附件地址:http://img.xiaonei.com/photos/20061121/2140/orig106920.rar

各种方法均有自己的优缺点,自己取舍吧。

好了,说了这么多了,希望大家有所收获。^_^。觉得好的顶下,觉得不好也请说说意见。


http://xiaonei.com/getuser.do?id=65383396


上一篇:校内网播放器代码汇总
下一篇:没有了
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册