Okrzyki, przyjaciel! (chaircrusher) wrote,
Okrzyki, przyjaciel!

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 clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

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:


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

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

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.

Originally published at Do My Eyes Look Scary?. You can comment here or there.

Tags: computers, music, the internets
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.