MP3 Button
October 5th, 2008

MP3 Button is a small, streaming Flash MP3 file player. It provides only two buttons, play and stop, and is capable of playing a single mp3 file. Parameters are available to allow you to specify the mp3 file, whether the music should auto-play, and to set the volume. The mp3 is streamed, so the music is available when the page loads although dial-up visitors will see a delay until enough music is buffered to begin playing.

Download mp3button.zip

After downloading and unzipping the mp3buttons.swf file, you will need to include it on your work page. Use the Import Foreign Object Tool to open the Foreign Object Editor. In the editor, select a Format type of Flash from the drop-down menu. Then using the Filepath button, locate the mp3buttons.swf file you extracted earlier.

Note: With this player, the Auto Start and Continuous Play options have no effect.

Multiple instances of the player on your work page are possible with each player using a different mp3 file. But it would be a good idea not to autostart more than one.

Looking at the Foreign Object/Media dialog example above, you can see that 2 parameters can be used with the player: flashvars and wmode.

The flashvars Parameter

The flashvars parameter specifies variables used by the player. The variables and their associated values are formatted as a GET query string. The various parameters that can be passed via the flashvars parameter are:

mp3 This variable is mandatory and is used to specify the location of the mp3 file on your site. The variable value can be either a path location or a URI specification. If you use the path location, you must specify the path relative to the published HTML page.
autostart This optional variable is used to specify if the music is to auto-play when the page loads. Possible values are 1 (auto-play) and 0 (do not auto-play). The default value is 0 if this variable is not specified.
vol This optional variable is used to specify the music volume. the value ranges from 0 (off) to 100 (max). The default is 10. This value will not change the volume setting on your visitor’s computer; it adjusts the volume of the music from the player.

Examples

mp3=http://mysite.com/audio.mp3&autostart=1&vol=50
mp3=http://mysite.com/media/my_music.mp3&autostart=0
mp3=some_music.mp3
mp3=/media/some_more_music.mp3&vol=80

The wmode Parameter

This parameter is optional. The mp3buttons player is designed with a charcoal gray background. As shown in the example Foreign Object/Media editor, you can specify a parameter name of “wmode” with a value of “transparent”. This will turn the player’s background transparent allowing your page background to become visible. You can also use the SiteSpinner shading tool to give the player a background color of your choosing.

Publishing Tips

When SiteSpinner publishes a project with the “Gather Files” option, flash files specified as foreign objects are automatically placed in a media folder on your site. If you plan to have your mp3 file in the same folder as the player, you can use the SiteSpinner FTP client using the steps outlined below.

Begin by using another foreign object, but this time use the Publish File type. Again, use the Filepath button to include the file into your project. When you publish your project, you will need to tell the publisher where to put the mp3 file, so on the Publisher?Pages tab, click the Select Folders button in the Path Options section. This will open the Publisher Sub-Directories window.

This window is used to specify where the various types of files should be placed when your project is published. It only handles file types that SiteSpinner is aware of, and unfortunately, SiteSpinner does not know about mp3 files. If published normally, the audio file would end up in the root folder of your site

However, any file SiteSpinner does not know how to handle is considered an external file, so using the External Files data field, you can enter “media” and the audio file will go to the proper folder when you publish your project.


5 Responses to “MP3 Button”

    admin says:

    In the new versions of SiteSpinner, the “Embed File/Media” tool button looks about the same but is now called “Embed a File or Media”. Clicking it will open the “Embed File or Media” window. If you do not see this button on your Tools toolbar, you may need to customize the toolbar to get the button to show (View->Toolbar Options…). You can also open the window using the Object->Embed File or Media menu item.

    When you get the Embed File or Media window open, insert the parameter and value in the “Parameters” Name and Value boxes.

    Michael Blum says:

    Don’t know how or where to enter parameters to play a specific mp3. The image of
    the Foreign Object/Media dialog doesn’t appear on my browser. Where are the flashvars parameters and the specific file info added?

    Linda Saltzman says:

    My previous comment should have read that the link from my button to my MP3 file is: C:\Users\Linda\#Web Stuff\MP3\Changed Lives\Changed Lives.mp3

    Linda Saltzman says:

    This is a neat little button but I’m seriously confused about what should be in the ‘flashvars’ ‘Value’ field. I now have a little button that represents my MP3 file (that opens in iTunes and plays from there)and the link to that button is: . Should this have any affect on how should be typed in the ‘Values’ field.
    Have I seriously confused you? Give me some help please!

    Rob Starkey says:

    This is an excellent mp3 button, easy to install and use, and works perfectly across all major browsers.
    Thank you for developing it.
    Best wishes,
    Rob

Leave a Reply

Spam protection by WP Captcha-Free


February 5th, 2012