网页中的多媒体播放控制源码精华教程
|
| 论文作者:佚名 论文来源:不详 论文发布时间:2006-6-20 2:40:55 论文发布人:chjchjchj |
减小字体
增大字体
MP3 以下内容为程序代码: <embed src="mm.mp3" width="147" height="44" AUTOSTART=TRUE></embed> meidy play能支持的都能放的 鼠标到,声音出,2个示例(以前贴过的) 以下内容为程序代码: <script language="vbs"> SUB btn1_onmouseover document.all("bgsoundone").src="http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/S/21.mid"; end sub sub btn1_onmouseout document.all("bgsoundone").src="" end sub SUB btn2_onmouseover document.all("bgsoundone").src="http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/S/11.mid"; end sub sub btn2_onmouseout document.all("bgsoundone").src="" end sub </script> <bgsound id=bgsoundone src="" loop=-1> <A href="#" name=btn1>HERE1</a><br><br> <A href="#" name=btn2>HERE2</a><EMBED src="http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/S/21.mid"; autostart="false" width="0" height="0" ><EMBED src="http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/S/11.mid"; autostart="false" width="0" height="0" > 点击什么音源,都在页面固定的“播放器”播放(以rm文件为例) 1.做一个小框架页 代码片段如下: 以下内容为程序代码: <IFRAME src="http://www.xiakedao.com/biyun/3/0/diangemain.htm"; marginwidth="0" marginheight="0" scrolling="no" frameborder="0" width="50" height="25" name="diange"></IFRAME> 2.这个内嵌框架页 width="72" height="17" ,框架无滚动条,刚好只显示REALPLAY播放器,不会露馅。注意设该框架页的名字。比如这里是diange 3.把以下这段代码放在你设定的框架页里,我这里是http://www.xiakedao.com/biyun/3/0/diangemain.htm页面,最好先把页边距设为0。 <embed height=25 src=http://www.xiakedao.com/biyun/ren/1.rm type=audio/x-pn-realaudio-plugin width=50 autostart="true" controls="PlayButton"> 4.这是一个实例 <IFRAME src="http://www.xiakedao.com/biyun/3/0/diangemain.htm"; marginwidth="0" marginheight="0" scrolling="no" frameborder="0" width="50" height="25" name="diange"></IFRAME> 其中http://www.xiakedao.com/biyun/3/0/diangemain.htm的原文件是 <body topmargin="0" leftmargin="0"> <embed height=25 src=http://www.xiakedao.com/biyun/ren/1.rm type=audio/x-pn-realaudio-plugin width=50 autostart="true" controls="PlayButton"> </body> 现在做一个框架页是为了让你点击连接后使RM文件在这个固定的播放器里播出而已。为每一个RM做一个类似diangemain.htm这样的页面,修改其中的声音地址就可以了。注意主页面里的连接要写明 target="diange"(你可以自己设定名字的,不过要与框架页的name="diange" 相对应) 控制媒体播放器音量(转贴 ) 以下内容为程序代码: <embed id=mm width=100 height=100 src=http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/H/1.mid></embed><br> <br> <button onclick=mm.ShowDialog(2)>Option</button> <HTML> <HEAD> <TITLE></TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Shift_JIS"> </HEAD> <BODY bgColor=#FFFFFF onload="currentBGM()"> <SCRIPT Language="JavaScript"> <!-- function currentBGM(){ if(bgmpath =="") return; var obj = document.bgmparent.bgmselect; for(i=0; i<obj.length; i++) { var val = obj.options[i].value; if(val == bgmpath) { obj.options[i].selected = true;} } } function bgmselecter(obj) { query= obj.options[obj.selectedIndex].value; if(query != "") { url = ((location.href).indexOf("?") != -1) ? (location.href).substring(0, (location.href).indexOf("?")) : (location.href); location.href = url +"?"+ query; } } var bgmpath = ""; //"..."偺拞偵堦夞栚傾僋僙僗帪偺壒妝僼傽僀儖傊偺僷僗傪彂偗傞丅 if(location.search != ("" "?")) { var chrat = location.search.indexOf("?"); bgmpath = location.search.substring(chrat+1, location.search.length); } if(bgmpath !="") { document.write("<bgsound src='" +bgmpath+ "' loop='infinite'>"); if(navigator.appName.indexOf("Netscape") != -1) { document.write("<EMBED SRC='" +bgmpath+ "' WIDTH=0 HEIGHT=0 PANEL=0 AUTOSTART=TRUE REPEAT=TRUE>"); } } //--> </SCRIPT> <center> <form mathod="post" name="bgmparent"> <select name="bgmselect" onChange="bgmselecter(this)"> <option value="">--SELECT BGM-- <option value="http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/H/1.mid";>BGM1 <option value="http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/H/2.mid";>BGM2 <option value="http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/H/3.mid";>BGM3 <option value="http://www.shunde.net.cn/~biyun/wlsd/wy/yinyue/H/4.mid";>BGM4 </select> </form> </center> </BODY> </HTML> 下拉菜单控制音乐出(无播放器) 以下内容为程序代码: <HTML> <HEAD> <TITLE></TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Shift_JIS"> </HEAD> <BODY bgColor=#FFFFFF onload="currentBGM()"> <SCRIPT Language="JavaScript"> <!-- function currentBGM(){ if(bgmpath =="") return; var obj = document.bgmparent.bgmselect; for(i=0; i<obj.length; i++) { var val = obj.options[i].value; if(val == bgmpath) { obj.options[i].selected = true;} } } function bgmselecter(obj) { query= obj.options[obj.selectedIndex].value; if(query != "") { url = ((locati
|
|
|
|
|
|
|
| ∷相关技术评论 |
(评论内容只代表网友观点,与本站立场无关!) [查看发表评论...] | |
|
|
| |
站内广告 |
| |
|
站内搜索 |
| |
栏目导航 |
| |
|
|
本月热门 |
| |
|
|
本日热门 |
| |
|
|
|