I have found pieces of explanations in the SWF Tools Install Guide and elsewhere, suggesting that an mp3 playlist can be created using SWF Tools, but I am still so lost. I would immensely appreciate if someone could provide me with some guidance.

Basically, what I want to do is group together a number of tracks for a music CD. Inserting the Pixel Out player for each track creates a very crude presentation that takes up a lot of space. I would love the presentation to be like the very clean XSPF Player.

This is what I've tried: I put the code below into a node (using php input format), but when I submitted the edit I got an error message reporting that no player had been configured for swftools_prepare_playlist_data.

// Generate some playlist data which is compatible with SWF Tools.
$playlist =  swftools_prepare_playlist_data(array('Song1.mp3', 'Song2.mp3'));

// Pass the playlist data to the playlist display function.
print swf_list($playlist);

// REMEMBER, that swf_playlist bahaves like swf(), so you can
// do all the same tricks with flashvars and params.
print swf_list($playlist);

If this is even close, I'm just not sure...

Thank you!
s.

Comments

susata’s picture

CORRECTION:

The error that I get when I insert the php code is:

No player is configured for the action 'swftools_mp3_display_list'

This error message repeats twice.

Apologies!

capellic’s picture

You may want to look into this thread: http://drupal.org/node/160265

Stuart Greenfield’s picture

The error No player is configured for the action 'swftools_mp3_display_list' normally occurs if you haven't specified a player for lists of mp3 files on the SWF Tools file handling settings page. Go to Administer > SWF Tools > File handling, open the File handling section, and choose the player you want to use under Default player for a list of MP3 music files:

You said you see the error twice - this is because you are calling print swf_list($playlist); twice!

To play a playlist, using the default player with default settings, you just need to write

// Generate some playlist data
$playlist =  swftools_prepare_playlist_data(array('Track1.mp3', 'Track2.mp3'));

// Simple call to swf_list to generate markup using default settings
print swf_list($playlist);

Just to make sure I didn't break anything recently I tested locally and it's working fine for me!

rockitdev’s picture

i am receiving the same error message as well.

No player is configured for the action 'swftools_mp3_display_list'

I created a block with an input format of PHP Code and included the following code:

// Generate some playlist data
$playlist =  swftools_prepare_playlist_data(array('songs/previews/Among The Living.mp3', 'songs/previews/Everyone.mp3'));

// Simple call to swf_list to generate markup using default settings
print swf_list($playlist);

and in the block i created, it prints the line "Sorry, flash is not available"

rockitdev’s picture

i tried using the development release and it does work.

however, the recommended stable release does not seem to work.

rockitdev’s picture

taking a look at the above PHP snippet, i have the following in an XML file it has created.



songs/previews/Among The Living.mp3

http://url.com/files/songs/previews/Among The Living.mp3
http://url.com/files/images/DonDave29.thumbnail.jpg
http://url.com/files/songs/previews/Among The Living.mp3
songs/previews/Everyone.mp3

http://url.com/files/songs/previews/Everyone.mp3
http://url.com/sites/all/modules/swftools/shared/swftools-default.jpg
http://url.com/files/songs/previews/Everyone.mp3

i can't seem to find any info on parameters if i wanted to use a different preview image etc.

Stuart Greenfield’s picture

Playlists are generated via the swftools_{playername}_playlist function within each player module. The idea of this function is to generate the appropriate mark-up that is then saved to the xml playlist file.

In this case of, say, Wijering, you can pass a flashvar called "image" that points to a specific file.

I am currently thinking about whether these xml generation functions are actually more akin to themes. If they were a theme function then in theory you could over-ride them by writing your own theme function to provide extended functionality.

The other method is to prepare the xml playlist by hand, and then point SWF Tools to use that instead.

All this stuff needs documenting properly, and that is next on the "To do" list after getting SWF Tools 6 out!

Stuart Greenfield’s picture

Status: Active » Closed (fixed)

This is a very old thread, and as there are no follow up posts (and as 5.x series is getting old now) I'm going to change this to closed unless someone objects and re-opens it!

thelionkingraja’s picture

I just want to use XSPF player for playlist.

I just created playlist through php code as follows.


$playlist =  swftools_prepare_playlist_data(array('audio/Arima Arima  - oruwebsite.com_.mp3', 'audio/Puthiya Manidha - oruwebsite.com_.mp3'));

print swf_list($playlist);

Any help much appreciated..