html5

Add HTML5 Audio to Drupal's Audio Module (for iPad for instance)

Recently, My father got an iPad; it's his one internet-enabled device. He mentioned that he couldn't listen to any of the audio on my site. Well, I found this to be unacceptable, and, while we still on the phone, I made the following changes to Drupal's Audio Module:

1. Add a class and title to the flash player.

FIrst, edit the "1pixelout.inc" file in the audio/players/ directory (or edit the .inc file for the play you have chosen to use.) Add the following class to the flash object tag: class="1pixelflashplayer". Also, add the following title attribute to the object tag: title="{$options['soundFile']}".

2. Add javascript to the page

The following javascript will search for all the flash players with the aforementioned class, hide them, and insert an <audio> tag after them with the src of the video from the flash player. Note: This will only work for mp3 audio files. You can download the javascript at the bottom of the page.

I Hope this helps someone.  Javascript follows...