|
1. | 2. | ||
3. | 4. |
The latest version of the standalone player files can be downloaded from WordPress Audio Player Download.
Copy the files audio-player.js and player.swf to your web folder.
Put code like this in the header of your web page:
<script type="text/javascript" src="audio-player.js"></script> <script type="text/javascript"> AudioPlayer.setup("player.swf", { width: 290 }); </script>
The "width" command sets the width of the player when it is playing. There are other display parameters you can adjust, see the WordPress player site for more information.
First create a placeholder for where the player is going to be embedded. A <div> tag is quite a good choice:
<div id="player001">Player goes here!</div>
Then enter this script to replace the placeholder with the flash player:
<script type="text/javascript"> AudioPlayer.embed("player001", { soundFile: "mp3_file.mp3" }); </script>
The ID for the <div> should match the ID used in the embed() function call. If you have more than one player, repeat this code but with unique IDs for each player instance.
This is what you get:
Also see the page How to play video from a web page using Flash.
Back to Computational Methods Home