Use Audio Player WordPress Plugin outside WordPress Blogs

I figured this out yesterday, and it is the sort of thing a lot of people would like to do and haven’t figured out yet.

First off, this is the audio player:
[audio:http://www.cornwarning.com/xfer/quicktime-vs-the-upsetter.mp3]
and you can read up on it at the AudioPlayer website. It’s very easy to integrate in WordPress, and putting a player in a post looks like this:

[audio:http://www.cornwarning.com/xfer/quicktime-vs-the-upsetter.mp3]

Second off, my ‘easy’ way to integrate it outside WordPress:
0. Make sure you can use PHP with your web server. This is pretty standard anymore; you’d probably have to install your own build of Apache to avoid having PHP.

1. First put this php function in a file. My version is here:http://www.cornwarning.com/php-includes/audioplayer.php

<?php
function audioplayer($audioURL,$playerIndex )
{
echo "<script language=\"JavaScript\"
src=\"http://YOURPATH/audio-player.js\">
</script>
<object type=\"application/x-shockwave-flash\"
data=\"http://YOURPATH/player.swf\"
id=\"audioplayer1\" height=\"24\" width=\"150\">
<param name=\"movie\" value=\"http://YOURPATH/player.swf\">
<param name=\"FlashVars\"
value=\"playerID=$playerIndex&soundFile=$audioURL\">
<param name=\"quality\" value=\"high\">
<param name=\"menu\" value=\"false\">
<param name=\"wmode\" value=\"transparent\">
</object>";
}
?>

2. You will need two files to make the player work: audio-player.js, and player.swf. In a WordPress install these will be in wp-content/plugins/audio-player/assets. Copy these someplace in your web directory — maybe the same place you put audioplayer.php. Then replace YOURPATH with the URL for that directory.

3. To use the audioplayer PHP function in an html page:

<?php include("http://YOURPATH/audioplayer.php"); ?>
<?php audioplayer("YourMP3URL",1); ?>

There you have it. Now I realize, not everyone writes their own web pages and most of the above might be pretty forbidding, but I hope that if you can write a simple web page and manage the files in your public_html, this is enough information to get you going.

2 thoughts on “Use Audio Player WordPress Plugin outside WordPress Blogs”

    1. The quickest way to annoy the living crap out of people is to start playing music as soon as they get to a site.

Leave a Reply