A skinnable, customizeable Flash media player.
You must have flash installed!
The XSPF Jukebox is a fully skinnable Flash media player. Based on my revisions of Fabricio Zuardi's original creation. A full featured media player, the Jukebox supports both mp3 audio and flv video parsed through an external .XSPF or .XML playlist. Custom skins combined with auto-resume and many customizable options make the XSPF Jukebox a solid choice for a Flash-based media player.
.mp3
audio and .flv
video(Optional) Automatically generate your playlists in PHP, Python, or JS
Edit the first line of the xplay.php
file to point to your media directory:
$media = "media"
Edit any options you wish, playlist caching is turned on by default.
<head>
:<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<div>
to hold your content: <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¶m1=value";
swfobject.embedSWF(url, "flashcontent", "skin width", "skin height", "7.0.0", "", {}, params, {});
</script>
Notice the values highlighted above, you must specify valid file paths for both the playlist_url
and skin_url
as well as the skin width
and height
. You may also specify any of the optional parameters following the playlist_url
. For example:
The entire url for the .swf on the demo page is:
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
That's it! The XSPF Jukebox is now installed.
The XSPF Jukebox can be customized for almost any need to play audio or video on the web.
You can also use the Jukebox to play a single .mp3 or .flv file, using the following two parameters in place of playlist_url:
track_title
: label of tracktrack_url
: url of trackplaylist_url
: the url of the xspf file to loadskin_url
: url of the skin folderloadurl
: url linking to a text file containing all variables. cuts down on html coding and file sizes, one file can be used by many playersactiveDownload
: boolean value to allow or disallow direct downloads of tracks, default is falsealphabetize
: boolean value to alphabetize playlist, default is falseautoload
: boolean value that makes the playlist load without the initial user click, default is falseautoplay
: boolean value that makes the playlist load and the music start without the initial user click, default is falseautoresume
: boolean value that allows players on multiple pages to seamlessly continue music as a user browses pages, default is falsebuffer
: seconds to preload video before playing, exclude for automaticcrossFade
: either a boolean value, which when true is set to the default time, or the number of seconds to fade (1-12), default is 6 secondsforceAlphabetize
: boolean value, forces full alphabetizing, including preceding 'the' in artist title, default is falseformat
: text to format track label, use "-creator, "-title, "-location, and "-annotation to insert respective values, default is "-creator : -titlegotoany
: boolean value that forces travel to unknown URLs, default is falseimage
: url for a jpg image that is shown when autoplay is offinfourl
: global info url for all songs, fills absent playlist info urlsload_message
: message displayed after autoloadmain_image
: global image url, fills absent playlist imagesmainurl
: right-click » "about" urlmidChar
: character placed to separate creator and title values for tracks, overwritten by format, default is ":no_continue
: boolean value to turn off automatic song changing, default is falseplayer_title
: title text, default is "Xspf Jukeboxrepeat
: boolean value to set repeat, default is falserepeat_playlist
: boolean value to repeat the playlist, default is trueshuffle
: boolean value to set shuffle, default is falsestart_track
: track number for beginning track, default is 1statsurl
: url to an external script that can collect POST values. Can collect playSong and annotationtimedisplay
: numerical value to show time counter; 0: off, 1: all, 2: elapsed, 3: duration, 4: countdowntrackNumber
: boolean value that adds track numbers to labels, default is falseuseId3
: boolean value that forces id3 tag use, default is falsevolume_level
: starting volume level percent, default is 100The XSPF Jukebox uses the XSPF (‘spiff’) open XML playlist format. A brief example follows:
<?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>
is requiredA javascript interface has been added into the player to allow for extended control over the Jukebox. This feature only applies to the Flash 8 version. Available functions are:
playTrack()
: play/pause the trackstopTrack()
: stop the tracknextTrack()
: advance to the next trackprevTrack()
: go back to the previous trackshuffleToggle()
: turn shuffle on/offrepeatToggle()
: turn repeat on/offgotoTrack(track number)
: play a specified trackaddTrack(track id, location, title, creator, info url, purchase url, image, annotation)
: add a track to the playlistTo control the Jukebox using Javascript, make sure that you have an id set in the object and embed tags for the embed script. To call a function, use the format:
window.document.xspfJukebox.playTrack();
For example:
<a href="https://github.com/lacymorrow/xspf-jukebox/blob/master/javascript:window.document.xspfJukebox.playTrack();">Click to Play </a>
The XSPF Jukebox uses a custom XML format to specify the player appearance. The skin.xml files are in the following format:
<?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="" />
All function objects begin with an
<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
: a play button, toggles between play and pauseplaypauseButton
: a static play pause button, toggles between play and pausestopButton
: a stop button, stops the trackprevButton
: a previous button, changes to the previous trackfwdButton
: a forward button, changes to the next trackshuffleButton
: a shuffle button, toggles on/offrepeatButton
: a repeat button, toggles on/offscrollButton
: a scroll button with background, scrolls playlistscrollupButton
: an up arrow, scrolls playlist upscrolldownButton
: a down arrow, scrolls playlist downstartButton
: a rectangle to indicate click location to start load or play, set alpha to 0infoButton
: text button to follow the current info link in a playlistpurchaseButton
: text button to follow the current purchase link in a playlistdownloadButton
: text button to directly link to the currently playing mp3playDisplay
: displays current track imagesimageDisplay
: displays current track imagesvideoDisplay
: displays video trackstrackDisplay
: displays currently playing tracktimeDisplay
: displays current track time in a standard format 00:00, toggles between time, duration, and time remainingfulltimeDisplay
: displays current track time in a full format 00:00/00:00, displays time and durationvolumeDisplay
: displays a volume bar to change track volumetimeBar
: displays current track percentage in bar form, click to scan trackloadBar
: displays loaded percentage for the current track in bar formx
: number : the x value or percentage for placing an objecty
: number : the y value or percentage for placing an objectz
: number : the z value, or depth of an object.width
: number : the width of an objectheight
: number : the height of an objectscale
: number : used in place of width/height. scales the object while retaining default aspect ratio. 1 = no scalingsize
: number : font size. size must be preceded by a + for infoButton, purchaseButton, and downloadButton. ex: +15image
: url : load an image in place of the default symbolshape
: rectangle/rectRounded/circle/triangle : draws a shape for an objectborder
: number : defines a shape?s border widthcolor
: hex code : sets the color of an object. ex: ff0088borderColor
: hex code : sets the color of an shape?s borderbgColor
: hex code : sets the color of an object?s backgroundselectedColor
: hex code : sets the color of the current track in the playlistfont
: font name : sets the text fonttext
: text : displayed textalign
: left/center/right : used only for trackDisplay. aligns textbold
: boolean : sets text bolding on/offitalic
: boolean : sets text italics on/offunderline
: boolean : sets text underline on/offalpha
: percent : sets alpha channel of objectbgAlpha
: percent : sets alpha channel of an object?s backgroundurl
: url : allows an object to link to a web pagehoverMessage
: text : message displayed on mouse over