Embedding the audio player in drupal

It's a pretty simple thing to do, but there appear to be no howto's anywhere online. The audio module in drupal provides you with the functionality to have a nifty little flash player for oyur podcasts and assorted audio; only problem being that it autogenerates the code for that player on it's own audio node page, and it is difficult to get it to work elsewhere (although the php is actually reasonably simple to get it going...have a look at the audio_get_player() function in audio.module). Any, the html is even easier, and gives you a little bit more flexibility on placement.

<object type="application/x-shockwave-flash" data=" http://<SITEURL>/modules/audio/players/mp3.swf
?song_url=http%3A//<SITEURL>/audio/play/<AUDIO-NODE-ID> " width="17" height="17"><param name="movie" value=" http://<DRUPALSITENAME>/modules/audio/players/mp3.swf
?song_url=http%3A//<SITEURL>/audio/play/<AUDIO-NODE-ID>" /><param name="wmode" value="transparent" /></object>

Replace the capitalised bits above with the details of your own site, and you're laughing. As a proof of concept, here's a audio track from openDemocracy done like this...

Comments

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
Sorry, but I hate spam, so please just fill it in...
7 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Back to top