还是有错,请看这里:

来源: 2010-08-14 09:55:22 [博客] [旧帖] [给我悄悄话] 本文已被阅读:

第一步:把你要播放器播放的所有曲子上传到网上(建议使用文学城的上传网站http://web.wenxuecity.com/upload.php)并获得得它们的网址。我得到的是:

(1)http://space.wenxuecity.com/media/1281688329.mp3
(2)http://space.wenxuecity.com/media/1281688668.mp3
(3)http://space.wenxuecity.com/media/1281688907.mp3
(4)http://space.wenxuecity.com/media/1281689171.mp3

第二步:编写内容为如下所示的文件,设文件名为songs.xml (文件名可以任意但其后缀必须是xml,即XML):

<?xml version='1.0' encoding='UTF-8' ?> <playlist version='1' xmlns='http://xspf.org/ns/0/'> <title>Sample PHP Generated Playlist</title> <info>littlesound</info> <trackList> <track><location>http://space.wenxuecity.com/media/1281688329.mp3</location><annotation> 01. 让世界充满爱:序曲</annotation><info>blank</info></track> <track><location>http://space.wenxuecity.com/media/1281688668.mp3</location><annotation> 02. 让世界充满爱:走向明天</annotation><info>blank</info></track> <track><location>http://space.wenxuecity.com/media/1281688907.mp3</location><annotation> 03. 让世界充满爱:幸福平安</annotation><info>blank</info></track> <track><location>http://space.wenxuecity.com/media/1281689171.mp3</location><annotation> 04. 让世界充满爱:永不分离</annotation><info>blank</info></track> </trackList> </playlist>

第三步:在你的博客网页中插入如下的HTML代码:

<embed style="WIDTH: 280px; HEIGHT: 180px" height="80" type="application/octet-stream" pluginspage="http://www.macromedia.com/go/getflashplayer" width="400" src="http://space.wenxuecity.com/media/1234581326.swf" border="0" wmode="transparent" quality="high" menu="false" flashvars="&config=http://space.wenxuecity.com/media/1277970459.xml&file=http://space.wenxuecity.com/media/1281695401.xml" /> </embed />

特别注意其中输入了地址:http://space.wenxuecity.com/media/1281695401.xml。这段代码将产生如下的能正常工作的播放器:

/>

第四步(optional):如果你不满意以上结果,可以做些小修改。比如,你可能觉得播放器下部过长需要缩短些,这可以把第四步中embed中的参数style="WIDTH: 280px; HEIGHT: 180px"中的180改小些。显而易见你也可以改变宽度参数280来改变播放器的宽度。如果你觉得播放器颜色的底色与文字对比度太小导致看不清文字,你可以把整个播放器置于一个黑色的表格中,即把第四步中的embed整个地放进一个黑色表格中,代码如下:

<table style="WIDTH: 30.2%; HEIGHT: 167px" border="1" cellspacing="1" cellpadding="1" bgcolor="#000000"><tbody><tr><td><embed style="WIDTH: 280px; HEIGHT: 160px" height="80" type="application/octet-stream" pluginspage="http://www.macromedia.com/go/getflashplayer" width="400" src="http://space.wenxuecity.com/media/1234581326.swf" border="0" wmode="transparent" quality="high" menu="false" flashvars="&config=http://space.wenxuecity.com/media/1277970459.xml&file=http://space.wenxuecity.com/media/1281695401.xml" /></embed /> </td></tr></tbody></table>

这段代码将产生如我原帖中所示的黑色播放器。