2007-04-26

設定 Flash MP3 Player v.2.3 音樂播放器

Step 1. 下載 Flash MP3 Player v2.3版的播放器 下載壓縮檔 到桌面

將檔案解壓縮後會看到有三個檔案:
1.mp3player.swf  flash播放器
2.playlist.xml  音樂清單
3.config.xml  flash播放器的設定

Step 2. 修改 config.xml 的設定

開啟 config.xml 音樂播放器的設定檔
( 按右鍵選擇記事本(Notepad)方式開啟 )

<mp3config>
<!-- choose here if you want the mp3player to automatically start and shuffle songs (true or false) -->
<!-- 設定是否自動播放 -->
<autostart>false</autostart>

<!-- 設定是否隨機或循環播放 -->
<shuffle>true</shuffle>

<!-- choose the mp3player repeat mode (none, one, all or list (plays the entire playlist once)) 設定播放重複模式 -->
<repeat>list</repeat>

<!-- choose the mp3player volume(0 to 100) 設定播放音量 -->
<volume>80</volume>

<!-- choose here if you want to show the display and playlist (true or false) 設定顯示正在播放曲目 -->
<showdisplay>true</showdisplay>

<!-- 設定顯示播放目錄 -->
<showplaylist>true</showplaylist>

<!-- choose here in what frame you want links to be opened (_blank, _self, _top or a framename) 設定連結視窗開起方式 -->
<linktarget>_top</linktarget>

<!--choose the mp3player colors(hexadecimal, from 0x000000 to 0xffffff)-->
<!-- 設定播放器背景顏色 -->
<backcolor>0xffffff</backcolor>

<!-- 設定播放器前景(包括文字、標誌顏色) -->
<frontcolor>0x000000</frontcolor>

<!-- 設定正在播放曲目&滑鼠接觸播放目錄時的顏色 -->
<lightcolor> 0xcc0000</lightcolor>

<!-- you can set a JPG as the background here to skin the mp3player(url to the jpg file) 設定使用播放器背景圖,在<jpgfile> 標籤內加入圖片檔網址(必須是JPG檔) -->
<jpgfile>http://image.jpg</jpgfile>

<!-- (for webmasters) URL of a script, called on start and completion of a song -->

<!-- the following vars are sent with POST: playlist, title, file, identifier, action ('start' or 'complete') -->
<callback>
</callback>
</mp3config>

Step 3. 修改 playlist.xml 音樂清單

開啟 playlist.xml
( 按右鍵選擇記事本(Notepad)方式開啟 )

<?xml version="1.0" encoding="UTF-8" ?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">

<info>http://www.jeroenwijering.com/?item=Flash_MP3_Player </info>
<!-- 歌曲清單開頭 -->
<tracklist>

<!-- 一首歌的開頭 -->
<track>

<!-- 這裡是歌名,可以有中文 -->
<annotation>歌名</annotation>

<!-- mp3檔案位置 -->
<location>mp3檔案位置http://song.mp3</location>

<!-- 可放相關的網頁連結,不需要則可不加 -->
<info>http://相關資訊的網頁連結</info>

<!-- 可選一張圖當歌的封面,不需要則可不加 -->
<image>封面圖的位置http://image.jpg</image>

<!-- 一首歌的結尾 -->
</track>

<!-- 另一首歌的開頭 -->
<track>
<annotation>歌名</annotation>
<location>http://song2.mp3</location>
<info>http://xxxx </info>
<image>http://image2.jpg</image>

<!-- 結尾 -->
</track>

<!-- 歌曲清單結束 -->
</trackList>
</playlist>

修改完畢後,記得還是以副檔名為 xml,編碼 UTF-8 儲存起來

Step 4. 將以上修改完的二個檔案 playlist.xml、config.xml
           及 mp3play.swf 上傳到個人網頁空間

Step 5. 插入Blog語法

簡式語法:

<embed src="播放器網址http://xxxx.mp3player.swf" width="205" height="280" flashvars="file=音樂清單網址http://xxxx.playlist.xml&config=播放器設定網址http://xxxx.config.xml"/></embed>


完整語法:

<embed src="播放器網址http://xxxx.mp3player.swf" width="205" height="280" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="file=音樂清單網址http://xxxx.playlist.xml&config=播放器設定網址http://xxxx.config.xml" /></embed>


成果如下:

我的設定播放器背景顏色
<backcolor> 0xe0e5b3 </backcolor>
<frontcolor> 0x333333 </frontcolor>
<lightcolor> 0xaf5783 </lightcolor>