Name

Blosxom Plug-In: mp3player


Synopsis

The mp3player plugin embeds a shockwave MP3 audio player applet/widget into articles containing links to mp3 files. It uses the player.swf, part of the WordPress Audio Player package by Martin Laine of 1pixelout: http://www.1pixelout.net/code/audio-player-wordpress-plugin/

Quick Start

1. Upload the provided player.swf into a location within your web server's DocumentRoot.

2. Edit the following configuration variables at the top of the mp3plater plugin script:

$player_url
Set to the full absolute URL of your player.swf file. This must be in a location that your browser can access.

@flavours
html is a reasonable default. If you need to embed the player into additional Blosxom flavors, indicate them here in a comma-separated and quoted list.

3. Upload this plugin to your $plugin_dir.

4. Edit your story.html templates to include the $mp3player::mp3player variable.

5. Within a story, place a link to an mp3 file, and add the enclosure parameter:

<a href="http://www.myhost.tld/audiofile.mp3" enclosure="true">

That should be it. When you re-load your Blosxom page, you should see player widgets appear in your stories.

Advanced Configuration

Player Configuration

You can customize the colors, size, and animation behavior of the Shockwave player. The default colors are various shades of gray that should look good in any layout.

Animation

When $player_params{animation} is set to yes, the default, the player appears as a small rounded rectagle containing a speaker icon and a right-pointing triangle (the PLAY button). When the play button is pressed, the player widens to reveal a progress bar and a text line indicating the title of the file.

When $player_params{animation} is set to no, the player remains at it's active width even when at idle.

Size

The height of the player is fixed at 24 pixels. The width is dynamic.

When animation is enabled and the player is idle, the visible width is approximately 75 pixels. When the player is active, it expands to the width set in the $player_width, or 250 pixels, whichever is greater. When the player is collapsed, it still occupies the full width set by this parameter.

When animation is disabled, the player remains at the width set by $player_width at all times.

Colors

Color values should be in standard HTML hexidecimal form: RRGGBB Do not precede the value with the usual pound sign (#) you would use in HTML or CSS.

See http://www.1pixelout.net/code/audio-player-wordpress-plugin/#colours for a graphical description of these parameters.

bg
Scroll area background colour.

leftbg
Speaker icon/Volume control background colour.

lefticon
Speaker icon colour.

rightbg
Right background colour.

rightbghover
Right background colour (hover).

righticon
Right icon colour.

righticonhover
Right icon colour (hover).

text
Text colour.

loader
Loader bar colour.

track
Progress track background colour.

tracker
Progress track colour.

border
Progress track border colour.

voltrack
Volume track colour.

volslider
Volume slider colour.

skip
Previous/Next skip button colours. (Not supported in this version of this plug-in.)


Current Version

0.3

Version History

0.3 of April 13, 2007

Revised to support version 2.0 of Martin Laine's Audio Player.

0.2 of April 12, 2007

Added configuration for player location, default audio file, and player color settings.

0.1 of April 7, 2007

First working version. Everything hard-coded. No configuration variables.

Planned Features

This current version looks for the enclosure parameter in an anchor tag. Strictly speaking, this is broken HTML and espeically bad XML. A future version should allow the option to look for all of the anchor tags which link to MP3 files and give the option to deploy a player at each one. If the enclosure_tags parameter is set, then enclosure parameters would not be necessary, nor would editing of the story template be required.

I'd like to find a way to define player colors within the HTML or CSS, rather than as parameters within the plugin's script.


Author

Steve Sergeant (stevesgt@effable.com)


Acknowledgements

Thanks to Martin Laine of 1pixelout for supporting my efforts and providing the player.swf code. See:

http://www.1pixelout.net/code/audio-player-wordpress-plugin/

The bulk of the code in this plugin was re-worked from the enclosure plug-in by Dave Slusher and Keith Irwin. See:

http://www.asyserver.com/~kirwin/enclosures_readme.txt

http://www.asyserver.com/~kirwin/enclosures2.zip

And in homage to the original code:

http://www.evilgeniuschronicles.org/wordpress/2004/08/22/get_enclosurespl/


See Also

Blosxom Home/Docs/Licensing: http://www.blosxom.com/

Blosxom Plugin Docs: http://www.blosxom.com/documentation/users/plugins.html


Bugs

Not tested, but if a link to the same audio file appears more than once on the same page, strange things might happen.

Not tested at all with static rendering, probably won't work.


License

This Blosxom Plug-in Copyright 2007, Steve Sergeant for Effable Communications

(This license is the same as Blosxom's) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ``Software''), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.