可易感的,可自定義的閃光媒體播放器。
您必須安裝Flash!
XSPF自動點唱機是一位完全易碎的閃光媒體播放器。根據我對Fabricio Zuardi原始創作的修訂。 Jukebox是全面的媒體播放器,支持MP3音頻和FLV視頻,該視頻通過外部.xspf或.xml播放列表進行了解析。自定義皮膚與自動清點和許多可自定義的選項相結合,使XSPF自動點唱機成為基於Flash的媒體播放器的可靠選擇。
.mp3音頻和.flv視頻(可選)自動在PHP,Python或JS中生成您的播放列表
編輯xplay.php文件的第一行,以指向您的媒體目錄:
$media = "media"
編輯您想要的任何選項,默認情況下,播放列表緩存將打開。
<head> : <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<div>保存您的內容: < div id =" flashcontent " >
<!-- this will be replaced -->
</ div > < script >
var params = { } ;
params.wmode="transparent";
params.allowscriptaccess="always";
var url = "xspf_jukebox.swf?playlist_url=xplay.php & skin_url = skins / iTunes & param1 = value " ;
swfobject . embedSWF ( url , "flashcontent" , "skin width" , "skin height" , "7.0.0" , "" , { } , params , { } ) ;
< / script >請注意上面突出顯示的值,您必須指定playlist_url和skin_url以及皮膚width和height的有效文件路徑。您也可以在playlist_url之後指定任何可選參數。例如:
演示頁面上.SWF的整個URL是:
xspf_jukebox . swf ? playlist_url = xplay . php & skin_url = skins / iTunes & autoplay = true & alphabetize = true & autoload = true & autoresume = true & main_image = images / artwork . jpg & shuffle = true & statsurl = stats . php就是這樣!現在安裝了XSPF自動點唱機。
可以對XSPF自動點唱機進行自定義,以便幾乎所有需要在網絡上播放音頻或視頻的任何需求。
您還可以使用以下兩個參數代替playlist_url:
track_title :軌道標籤track_url :軌道的URL playlist_url :XSPF文件的URL加載skin_url :皮膚文件夾的URLloadurl :URL鏈接到包含所有變量的文本文件。削減HTML編碼和文件大小,許多播放器可以使用一個文件activeDownload :布爾值允許或禁止直接下載軌道,默認值為falsealphabetize :布爾值以字母表播放列表,默認值為falseautoload :布爾值,它使播放列表負載無初始用戶單擊,默認值為falseautoplay :使播放列表負載和音樂啟動而無需初始用戶單擊的布爾值,默認為falseautoresume :允許多個頁面上的玩家在用戶瀏覽頁面時無縫繼續音樂的布爾值,默認為falsebuffer :播放前的幾秒鐘預加載視頻,不包括自動crossFade :一個布爾值,當True設置為默認時間時,或淡入淡出的秒數(1-12),默認值為6秒forceAlphabetize :布爾值,全部字母表的力format :格式軌道標籤的文本,使用“ -creator”,-title,-location''和“ -antotation插入各個值,默認值為” -CREATOR:-TITLEgotoany :迫使前往未知URL的布爾值,默認值為falseimage :自動播放關閉時顯示的JPG圖像的URLinfourl :所有歌曲的全球信息URL,填充缺席播放列表信息URLload_message :自動加載後顯示的消息main_image :全局圖像URL,填充缺席的播放列表圖像mainurl :右鍵單擊»“關於” urlmidChar :符合曲目的分離創建者和標題值的角色,格式覆蓋,默認值為“::no_continue :打開自動歌曲更改的布爾值,默認值為falseplayer_title :標題文本,默認為“ xspf jukeboxrepeat :布爾值要設置重複,默認值為falserepeat_playlist :重複播放列表的布爾值,默認值為trueshuffle :布爾值設置洗牌,默認值為falsestart_track :開始軌道的軌道號,默認值為1statsurl :可以收集郵政值的外部腳本的URL。可以收集彈奏和註釋timedisplay :顯示時間計數器的數值; 0:OFF,1:全部,2:經過,3:持續時間,4:倒計時trackNumber :將曲目編號添加到標籤中的布爾值,默認值為falseuseId3 :強制ID3標籤使用的布爾值,默認值為falsevolume_level :啟動音量級別百分比,默認值為100 XSPF Jukebox使用XSPF('Spiff')打開XML播放列表格式。一個簡短的例子如下:
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="0" xmlns="http://xspf.org/ns/0/">
<trackList>
<track>
<location>url of .mp3 audio or .flv video file</location>
<creator>artist or creator of track</creator>
<title>title of track</title>
<annotation>used in place of creator/title if both are absent</annotation>
<duration>number of milliseconds of track duration</duration>
<info>url of info link</info>
<image>url of image, overwrites main_image parameter</image>
<purchase>url of purchase link</purchase>
</track>
</trackList>
</playlist>
<location> JavaScript接口已添加到播放器中,以允許對自動點唱機進行擴展控制。此功能僅適用於Flash 8版本。可用功能是:
playTrack() :播放/暫停軌道stopTrack() :停止軌道nextTrack() :前進到下一條曲目prevTrack() :返回前面的曲目shuffleToggle() :打開/關閉式洗牌repeatToggle() :打開/關閉gotoTrack(track number) :播放指定的曲目addTrack(track id, location, title, creator, info url, purchase url, image, annotation) :在播放列表中添加軌道要使用JavaScript控制自動點唱機,請確保您在對像中具有ID集,並為嵌入腳本嵌入標籤。要調用函數,請使用格式:
window.document.xspfJukebox.playTrack();
例如:
<a href="javascript:window.document.xspfJukebox.playTrack();">Click to Play </a>
XSPF Jukebox使用自定義XML格式來指定播放器外觀。 skin.xml文件以以下格式:
<?xml version="1.0" encoding="UTF-8"?>
<skin version="0" xmlns="http://xsml.org/ns/0/">
<name>skin name</name>
<width>skin width</width>
<height>skin height</height>
<author>skin author</author>
<email>author?s email</email>
<website>author?s website</website>
<comment>author?s comments</comment>
<object>
all skin objects reside between the <object> tags
</object>
</skin>
<background x="" y="" width="" height="" scale="" image="" shape="" border="" color="" borderColor="" alpha="" /><image x="" y="" z="" width="" height="" image="" alpha="" url="" target="" hoverMessage="" /><shape x="" y="" z="" width="" height="" shape="" border="" color="" borderColor="" alpha="" url="" target="" hoverMessage="" /><text x="" y="" z="" size="" color="" font="" text="" border="" bold="" italic="" underline="" alpha="" url="" target="" hoverMessage="" /><playlist x="" y="" z="" width="" height="" size="" color="" font="" selectedColor="" bold="" italic="" underline="" alpha="" hoverMessage="" /><badge x="" y="" width="" height="" />所有函數對象均以標籤開頭,並通過label屬性進行區分。大多數標籤具有相似的屬性,但是存在一些微小的差異。
<object label="playButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="playpauseButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="stopButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="prevButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="fwdButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="shuffleButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="repeatButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="scrollButton" x="" y="" z="" width="" height="" scale="" image="" color="" bgColor="" alpha="" bgAlpha="" hoverMessage="" /><object label="scrollupButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="scrolldownButton" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="startButton" x="" y="" z="" width="" height="" scale="" color="" alpha="" hoverMessage="" /><object label="infoButton" x="" y="" z="" size="" color="" font="" text="" bold="" italic="" underline="" target="" hoverMessage="" /><object label="purchaseButton" x="" y="" z="" size="" color="" font="" text="" bold="" italic="" underline="" target="" hoverMessage="" /><object label="downloadButton" x="" y="" z="" size="" color="" font="" text="" bold="" italic="" underline="" target="" hoverMessage="" /><object label="playDisplay" x="" y="" z="" width="" height="" scale="" color="" alpha="" hoverMessage="" /><object label="imageDisplay" x="" y="" z="" width="" height="" scale="" color="" alpha="" hoverMessage="" /><object label="videoDisplay" x="" y="" z="" width="" height="" scale="" alpha="" hoverMessage="" /><object label="trackDisplay" x="" y="" z="" width="" size="" color="" font="" text="" align="" bold="" italic="" underline="" hoverMessage="" /><object label="timeDisplay" x="" y="" z="" size="" color="" font="" text="" bold="" italic="" underline="" hoverMessage="" /><object label="fulltimeDisplay" x="" y="" z="" size="" color="" font="" text="" bold="" italic="" underline="" hoverMessage="" /><object label="volumeDisplay" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="timeBar" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" /><object label="loadBar" x="" y="" z="" width="" height="" scale="" image="" color="" alpha="" hoverMessage="" />playButton :播放按鈕,在播放和暫停之間切換playpauseButton :靜態播放暫停按鈕,在播放和暫停之間切換stopButton :停止按鈕,停止軌道prevButton :先前的按鈕,更改為上一首曲目fwdButton :向前按鈕,更改為下一個曲目shuffleButton :洗牌按鈕,打開/關閉repeatButton :重複按鈕,打開/關閉scrollButton :帶有背景的滾動按鈕,捲軸播放列表scrollupButton :上箭頭,捲軸播放列表scrolldownButton :下垂的箭頭,滾動播放列表startButton :一個矩形,指示單擊位置開始加載或播放,將alpha設置為0infoButton :文本按鈕以遵循播放列表中的當前信息鏈接purchaseButton :文本按鈕遵循播放列表中當前的購買鏈接downloadButton :直接鏈接到當前播放mp3的文本按鈕playDisplay :顯示當前曲目圖像imageDisplay :顯示當前曲目圖像videoDisplay :顯示視頻曲目trackDisplay :顯示當前播放軌道timeDisplay :以標準格式00:00顯示當前軌道時間,在時間,持續時間和剩餘時間之間切換fulltimeDisplay :以完整格式顯示當前軌道時間00:00/00:00,顯示時間和持續時間volumeDisplay :顯示一個音量欄以更改軌道音量timeBar :以條形顯示當前軌道百分比,單擊以掃描軌道loadBar :顯示當前軌道的加載百分比x :數字:放置對象的X值或百分比y :數字:放置對象的y值或百分比z :數字:z值或對象的深度。width :數字:對象的寬度height :數字:物體的高度scale :數字:代替寬度/高度。在保留默認縱橫比的同時縮放對象。 1 =無縮放size :數字:字體大小。尺寸必須先於Infobutton,pautobutton和downloadbutton的 +。例如:+15image :URL:加載圖像代替默認符號shape :矩形/矩形/圓形/圓/三角形:繪製對象的形狀border :數字:定義形狀的邊界寬度color :十六進制代碼:設置對象的顏色。例如:FF0088borderColor :十六進制代碼:設置形狀邊框的顏色bgColor :十六進制代碼:設置對象背景的顏色selectedColor :十六進制代碼:在播放列表中設置當前曲目的顏色font :字體名稱:設置文本字體text :文字:顯示的文字align :左/中心/右:僅用於TrackDisplay。對齊文字bold :布爾值:設置文本大膽打開/關閉italic :布爾:設置文本斜體開/關underline :布爾值:設置文本下劃線開/關alpha :百分比:設置對象的alpha通道bgAlpha :百分比:設置對象背景的alpha通道url :URL:允許對象鏈接到網頁hoverMessage :文字:鼠標上顯示的消息麻省理工學院©Lacy Morrow