Creating playlists (eg. xml files) on the fly
Last modified: September 13, 2008 - 13:56
What is a playlist?
A "playlist" is a general term for set of files which are displayed together or in sequence by a Flash player. It could be a list of videos, MP3s, images, or a mix of these. Within SWF Tools they take the form of a general structured list of data that will eventually find it's way into an XML file.
Displaying a list of files as a playlist
SWF Tools provides a useful function for generating playlist data: swftools_prepare_playlist_data(). This is really useful for quick results where you have a list of files and you just want to push them out. Once you have your playlist data, you can then pass it to a variation of the swf() function called swf_playlist().
<?php
// Generate some playlist data which is compatible with SWF Tools.
$playlist = swftools_prepare_playlist_data(array('image1.jpg', 'image2.jpg'));
// Pass the playlist data to the playlist display function.
print swf_playlist($playlist);
// REMEMBER, that swf_playlist bahaves like swf(), so you can
// do all the same tricks with flashvars and params.
print swf_playlist($playlist, '400x300');
?>
The function swf_playlist()
The function
swf_playlist()does not exist. It should beswf_list().-zach
--
harkey design