Extension:FlashMP3

The FlashMP3 extension embeds a simple Flash-player for playback of mp3-files. It is based on the great Audio Player Wordpress plugin by 1pixelout. It can handle multiple local and/or remote files in one player and multiple players on each site. The appearance of the player is highly customizable.

It is also possible to use the nice last.fm player with the files hosted there. It works on a label, artist, album or song-level.

For problems and suggestions please use the discussion page of this article.

Installation
1. Open a new text (notepad) file.

2. Copy & paste the code below in the newlt created text (notepad) file.

3. Save the file as flashmp3.php

4. Place it in a new folder called FlashMP3 in your extensions directory.

5. Download the standalone Audio Player plugin from 1pixelout.

6. Open the downloaded plugin.

7. From the zip file copy the files audio-player.js and player.swf.

8. Place the audio-player.js and player.swf in the folder FlashMP3 you just created.

10. Near the end of your LocalSettings.php file in the MediaWiki root folder add this line:

Uploading mp3-files
To be able to upload mp3-files to your MediaWiki also do the following steps.

1. Allow uploading of mp3-files by adding this line near the end of your LocalSettings.php.

2. Set the maximum size for file uploads in your php.ini.

3. Set the maximum size for file uploads by adding this line to your LocalSettings.php. The value is the maximum size of the file in bytes.

Code
You can change the Default Title ($restTitle) and the Default Album Cover ($albumArt) in line 87 and line 91 respectively to your needs (for last.fm player only).

not found  '; }

Base Command
filename.mp3 can be the name of a file uploaded to the Wiki or an external URL. Additional parameters are optional.

Multiple files
Multiple files can be played in one FlashMP3 player one after the other by separating them with comma.

Multiple players
Multiple FlashMP3 players on one site can be achieved by giving them an id.

secondmp3.mp3

Examples
mymp3.mp3

Plays an uploaded mp3-file called mymp3.mp3.

http://www.somedomain.com/mp3/mymp3.mp3

Plays the remote mp3-file from the URL http://www.somedomain.com/mp3/mymp3.mp3.

mymp3.mp3,yourmp3.mp3|autostart=yes|loop=yes

Plays the two uploaded files mymp3.mp3 and yourmp3.mp3 one after the other, autostarts playing when the site is loaded and loops the files.

Base Command
resourceID and resourceType have to be retrieved from the source of the last.fm page of which you want to embed the player (Right Click -> View Page Source and search for resourceID and resourceType). Both resourceID and resourceType are compulsory. Additional parameters are optional.

resourceType is either artist, album, song, label, playlist or the ID-number directly (if you know it).

Optional commands
Additional parameter are possible as long as the last.fm player can interpret them in the given situation (i.e. resourceType).

Examples
11572702|artist

Plays songs from the given artist (Tookoo).

51022335|song|firstTrackName=Dance+For+Yourself|firstArtistName=TOOKOO|albumArt=http://static.last.fm/coverart/130x130/3245162.jpg|restDuration=227

Plays the given song and displays the track name, artist name and duration as well as the cover right after loading.

Limitations

 * The default player has a white background at the beginning when still folded. This is a limitation of the 1pixelout player and can not be changed. ( Firefox on Linux only!? )
 * For the last.fm player you have to search the source code to find the resourceID. To my knowledge there is no better way to do this at the moment.
 * More than 15 players embedded on a page will not work under Firefox
 * Can not recognize Unicode file names
 * Files used by FlashMP3 will show up in the Special:Unused Files
 * Resource-hostile. Can lag the reader's computer easily if too many MP3 files embedded in the same page.
 * When this becomes a severe issue of your wiki, think of converting your MP3 files to Vorbis OGG audio format and use the more resource-friendly OGG player.

Changelog

 * v0.92 (2012-01-20)
 * Combatible with MW v1.18.1


 * v0.91 (2007-04-03)
 * fixed some possible Cross-site scripting vulnerabilities


 * v0.9 (2007-03-04)
 * added last.fm player


 * v0.8 (2007-02-25)
 * initial release