Embedding and Distributing Flourish Player
Flourish player can easily be embedded into any HTML page. An example HTML file suitable for all major browsers is included in both source and binary distribution (called index.html).
Creating XSPF playlists
Please refer to http://xspfs.org for more information on XSPF playlists - your favorite media player may already be able to generate XSPF playlists. Please note that relative paths given in the XSPF playlist are always considered relative to the location of the playlist file.
Embedding options
The relevant part of the HTML file embedding flourish player looks like this:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="225" height="24" id="video" align="middle"> <param name="allowScriptAccess" value="sameDomain"> <param name="movie" value="flourish-player.swf?playlisturl=playlist%2Exml"> <param name="quality" value="high"> <embed src="flourish-player.swf?playlisturl=playlist%2Exml" quality="high" width="225" height="24" name="video" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object>
If the file flourish-player.swf is not located in the same directory as the HTML file, you will have to change both ocurrences of flourish-player.swf (without the quotation marks) to whatever/your/path/is/flourish-player.swf (adopted to suit the real path).
The player has several GET parameters that are present twice in the HTML code - You can find two lines containing flourish-player.swf?. The part between the trailing question mark and the following quotation mark contains GET parameters in the form name=value. If two or more GET parameter are present, they must be separated by ampersands (&).
The following GET parameters are available:
- playlisturl
- Denotes the URL (absolute, relative or fully qualified) that
flourish player should load the URL from. Please note that you
might need to replace .xml with %2Exml, because otherwise
Internet Explorer thinks that the swf file is in fact an XML
document... :S
This parameter is mandatory, flourish player will not work without a playlist URL.
Examples:
playlisturl=mylist.xml (Loads the playlist mylist.xml from the same directory as the HTML file)
playlisturl=../list.xspf (Loads the playlist list.xspf from the parent directory of the HTML file)
playlisturl=http://example.com/list.xml (Loads the playlist list.xml from http://example.com) - autoplay
- If autoplay=1 is given as a GET parameter, the player will start playing the first track of the playlist as soon as the playlist has been loaded.
- autoload
- If autoload=1 is given as a GET parameter, the player will preload the data of the first track as soon as the playlist has been loaded. Otherwise, the data will only be loaded as soon as the play button is clicked. Enabling autoloading is only recommended on pages that are not frequently reloaded, otherwise this option will generate a lot of traffic. Of course, autoplaying implies autoloading.
Examples of flourish player URLs (occurring twice in the HTML code, each time between quotation marks):
- flourish-player.swf?playlisturl=audio/mylist%2Exml
- The file flourish-player.swf is located in the same directory as the HTML file. It will load the file mylist.xml from the sub-directory audio. It will neither autoload nor autoplay the first track.
- swf/flourish-player.swf?playlisturl=mylist.xspf&autoload=1
- The file flourish-player.swf is located in the sub-directory swf of the directory containing the HTML file. It will load the playlist mylist.xspf from the same directory as the HTML file and automatically start preloading the first track of the playlist.
- swf/flourish-player.swf?playlisturl=http://example.org/list.xml&autoplay=1
- The file flourish-player.swf is located in the sub-directory swf of the directory containing the HTML file. It will load the playlist list.xml from http://example.org and automatically start playing the first track of the playlist.
Distribution
To distribute flourish player, simply upload the embedding HTML file and flourish-player.swf to your web server. The file flourish-classes.swf is NOT needed on the server, as its content has already been embedded in flourish-player.swf (the binary distribution therefore does not include flourish-classes.swf).
Of course you may also need to upload the XSPF playlist and / or the audio files to your web server.