7 BƯỚC TẠO PLAYLIST NHẠC
1. Upload một ảnh nền định dạng jpg và một số bài nhạc định dạng mp3 vào host.
2. Download file playlist.zip.
3. Unzip file vừa download vào một folder bất kỳ trong máy của bạn. Kiểm tra đủ ba files: playlist.xml, config.xml và mp3player.swf.
4. Mở file playlist.xml bằng notepad (click chuột phải, chọn open with notepad) và tìm đoạn mã sau:
<track>
annotation>Tên bài hát - Người sáng tác - Ca sĩ thể hiện</annotation>
<location>URL của bài hát</location>
</track>
- annotation: sửa lại tên bài hát trong list nhạc của bạn;
- location: địa chỉ URL của bài hát, bắt đầu bằng http://
Khi hoàn tất, bạn save với định dạng xml. Lưu ý, nếu bạn có nhiều playlist cho nhiều post khác nhau, bạn phải đặt tên khác nhau cho những file playlist này, ví dụ playlist1.xml, playlist2.xml,...
5. Mở file config.xml bằng notepad:
<mp3config>
<!-- choose here if you want the mp3player to automatically start and shuffle songs (true or false) -->
<autostart>false</autostart>
<shuffle>false</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>_blank</linktarget>
<!-- choose the mp3player colors (hexadecimal, from 0x000000 to 0xffffff) -->
<backcolor>0xffffff</backcolor>
<frontcolor>0x000000</frontcolor>
<lightcolor>0xC7EF65</lightcolor>
<!-- you can set a JPG as the background here to skin the mp3player (url to the jpg file) -->
<jpgfile></jpgfile>
<!-- (for webmasters) URL of a script, called on start and completion of a song -->
<!-- the following vars are sent with POST: title, file, identifier, action ('start' or 'complete') -->
<callback></callback>
</mp3config>
<!-- choose here if you want the mp3player to automatically start and shuffle songs (true or false) -->
<autostart>false</autostart>
<shuffle>false</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>_blank</linktarget>
<!-- choose the mp3player colors (hexadecimal, from 0x000000 to 0xffffff) -->
<backcolor>0xffffff</backcolor>
<frontcolor>0x000000</frontcolor>
<lightcolor>0xC7EF65</lightcolor>
<!-- you can set a JPG as the background here to skin the mp3player (url to the jpg file) -->
<jpgfile></jpgfile>
<!-- (for webmasters) URL of a script, called on start and completion of a song -->
<!-- the following vars are sent with POST: title, file, identifier, action ('start' or 'complete') -->
<callback></callback>
</mp3config>
- autostart: tự động chạy playlist, gồm hai lựa chọn - có (true) hoặc không (false). Theo tôi bạn không nên để tự động vì có thể làm phiền khách thăm blog của bạn.
- shuffle: chơi nhạc không theo thứ tự đã định trong file playlist.xml (random), cũng có hai lựa chọn - true và false.
- repeat: chơi lại toàn bộ playlist, bao gồm 4 lựa chọn - none (không lập lại), one (1 bài), all (tất cả các bài) hoặc list (lập lại toàn bộ list một lần).
- volumn: chỉnh âm thanh, từ 0 đến 100.
- showdisplay: hiển thị thanh điều khiển (true/ false).
- showplaylist: hiển thị tên các bài hát (true/ false).
- linktarget: khi click vào link thì sẽ mở ở cửa sổ khác (_blank), cùng cửa sổ (_self), hoặc toàn màn hình (_top) trong trường hợp dùng frame. Cái điều kiện này tôi chẳng hiểu để làm gì, vì tôi có thấy cái link nào đâu?
- backcolor: màu nền.
- frontcolor: màu text trong list.
- lightcolor: màu text khi có chuột chạy qua, hoặc được chọn.
- jpgfile: file.jpg làm nền cho playlist (đã upload ở bước 1), bắt đầu bằng http://
- callback (cái này chưa nghiên cứu được là gì

Sau khi chỉnh sửa, bạn save với định dạng xml. Cũng tương tự file playlist.xml, nếu bạn muốn mỗi list nhạc có một hình nền khác nhau, bạn phải save các file config này với tên gọi khác nhau, ví dụ config1.xml, config2.xml,...
6. Upload ba files mp3player.swf, playlist.xml và config.xml vào host.
7. Copy và paste đoạn mã này vào entry:
<embed hspace="5" vspace="5" src="mp3player.swf" menu="false" quality="high" width="450" height="338" name="index" allowScriptAccess="never" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="&config=config.xml&file=playlist.xml" wmode="transparent" border="0"></embed>
Ngoài ra, bạn cũng cần chú ý những thông số sau:
- menu: thanh điều khiển list nhạc, có hai lựa chọn - true (tự động chạy) hoặc false (phải nhấn nút play).
- width: chiều ngang của tấm ảnh nền.
- height: chiều cao của tấm ảnh nền.
Vậy là xong rồi đó


No comments:
Post a Comment