2015年高级软考辅导:网页设计之网页音乐的实现技巧
发布时间:2010/6/23 19:57:36 来源:城市学习网 编辑:admin
当网页中插入音乐时,要根据不同的后缀名,来写不同的代码!下面面就是多种格式文件的详细使用代码。
注:
"音乐文件和地址"——待播放文件的文件名,前面带上绝对路径,或者本站的相对路径。
width_num——指定一个作为宽度的数字;
height_num——指定一个作为高度的数字;
1.mid
%26lt;embed src="音乐文件和地址" type="audio/midi" hidden="false" autostart="true" loop="true" height=height_num width=width_num%26gt;%26lt;/embed%26gt;
2.mp3
%26lt;embed controller="true" width="width_num" height="height_num" src="音乐文件和地址" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html"%26gt;%26lt;/embed%26gt;
3.avi
%26lt;embed src="音乐文件和地址" border="0" width="width_num" height="height_num" type="application/x-mplayer2"%26gt;%26lt;/embed%26gt;
4.flash
%26lt;embed src="音乐文件和地址" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="width_num" height="height_num" play="true" loop="true" quality="high" scale="showall" menu="true"%26gt;%26lt;/embed%26gt;
5.mpg
%26lt;embed src="音乐文件和地址" border="0" width="width_num" height="height_num" type="application/x-mplayer2"%26gt;%26lt;/embed%26gt;
6.mov
%26lt;embed controller="true" width="width_num" height="height_num" src="音乐文件和地址" border="0" pluginspage="http://www.apple.com/quicktime/download/indext.html"%26gt;%26lt;/embed%26gt;
7.rm
%26lt;OBJECT%26gt;" height="height_num"%26gt;
%26lt;PARAM NAME="CONTROLS" VALUE="ImageWindow"%26gt;
%26lt;PARAM NAME="AUTOSTART" Value="true"%26gt;
%26lt;PARAM NAME="SRC" VALUE="音乐文件和地址"%26gt;
%26lt;embed height="高" width="宽" controls="ImageWindow" src="音乐文件和地址" type="audio/x-pn-realaudio-plugin" autostart="true" nolabels="0" autogotourl="-1"%26gt;%26lt;/OBJECT%26gt;
8.上面的都是使用播放器的,如果只是想播放背景音乐的话可以使用如下简单语句:
%26lt;bgsound src="音乐文件和地址" loop=1%26gt;
loop后面是循环的次数,-1代表无限循环。