#

MP3 Tag

And one more WordPress plugin:
This one makes life easier, when you use an embedded MP3-player on your blog.

  • Introduction
  • Function
  • History
  • Compatibility
  • Installation
  • Usage
  • Download
  • Donate
  • Seen at
  • Introduction

    You shurely know that: To embed a flash MP3 player, like the dewplayer which I use, you have to define that ugly object tag like

    <object type="application/x-shockwave-flash"
     data="../../mp3/dewplayer.swf?son=../../mp3/silver+spyder+sam+-+blind+cat.mp3" 
      height="20" 
      width="200">
      <param name="movie" 
        value="../../mp3/dewplayer.swf?son=../../mp3/silver+spyder+sam+-+blind+cat.mp3">
    </object>

    where the relative paths to the player and MP3 file have to be entered twice.

    And then there is that big problem with the relative paths, since the players need the relative path to the MP3 file. If you define that path on a post, which is displayed at the root URL of your page, e.g. “http://myblog/mypost-with-mp3.html”, then that path must be empty (e.g. data=”mp3/dewplayer.swf?son=mp3/silver+spyder+sam…) and if the post is referenced from a deeper path (like the categories page) like in “http://myblog/music/” the relative path has to be “../” and so on.

    Function

    This tiny plugin, called “MP3 Tag” makes things easier. It supports two tags you can include anywhere in your posts: One for the player and one for a download link to the mp3 file.

    [mp3player:myalbum/mymp3file] will generate that player object, while it will recognize which
    ULR is actually involved and calculate a relative path to the root (e.g. “../”). And it will recognize, that you didn’t specify a file extension and will append the missing “.mp3″ to the referenced filename and generate the following output:

    <object type="application/x-shockwave-flash" 
      data="../mp3/dewplayer.swf?son=../mp3/myalbum/mymp3file.mp3" 
      height="20" width="200">
      <param name="movie" 
        value="../mp3/dewplayer.swf?son=../mp3/myalbum/mymp3file.mp3">
    </object>

    And if you use non-ascii characters in your filenames, you can configure the plugin to escape the pluginname with urlencode:
    [mp3player:myalbum/myartist – mymp3file]
    will generate

    <object type="application/x-shockwave-flash" 
      data="../mp3/dewplayer.swf?son=../mp3/myalbum/myartist+-+mymp3file.mp3"
      height="20" width="200">
      <param name="movie" 
        value="../mp3/dewplayer.swf?son=../mp3/myalbum/myartist+-+mymp3file.mp3">
    </object>

    By the way: All of it is configurable through options and templates on the admin/options panel. So it should fit most embedded players. If not, try the free one I mentioned above.

    [mp3download:myalbum/myfile]
    will create a link pointing to the MP3-file with the text “myfile.mp3″ or “myfile” (configurable, too).
    Additionaly you can define a link text:
    [mp3download:myalbum/myfile:Download]
    which will create a link with the text “Download”.

    The plugin is mostly self-explanatory, have a look at the options page, where every option is explained.

    History

    Version: 1.1 – update

  • Predefined values for MP3 player URI with javascript for some well known and working free flash mp3 players
  • Instead of escaping only whitespaces a full urlencode is done (when activated)
  • Some more information and examples on configuration page
  • Display of a test example to show current configuration
  • Added debugging info
  • Added %%mp3name as placeholder for MP3 player URI
  • Version: 1.0 – initial

    Compatibility

    Tested with WordPress 2.1.3 up to 2.9.1.

    Installation

    Just upload to your wp-content/plugins folder or any subfolder and activate in plugins menue. Then go to the admin/options/MP3 Tag options page and configure.

    Usage

    [mp3download:MP3FILE:LINKTEXT]
    With:

  • MP3FILE is the absolute path to the MP3 file (fileextension is optional) starting at the root folder for the MP3 files
  • LINKTEXT is an optional text for the created link. May not contain a “]” symbol.
  • [mp3player:MP3FILE]
    With:

  • MP3FILE is the absolute path to the MP3 file (fileextension is optional) starting at the root folder for the MP3 files
  • Rest is configured through options, including the used template.
  • Download

    version 1.1 here
    version 1.0 here

    Donate

    If you like this plugin and it helps so much, that you would like to donate (no matter how much), please do it here.

    Seen at

  • au8ust’s wordpress channel
  • Leave a Reply »»

    Note: All comments are manually approved to avoid spam. So if your comment doesn't appear immediately, that's ok. Have patience, it can take some days until I have the time to approve my comments.