Hearing Voices uses the WPAudioPlayer plug, which, since it’s Flash, the iPhone can’t see. But iPhone Safari is HTML 5 aware, and supports mp3 play. So here’s our quick&filthy fix. In the file:
/plugins/audio-player/audio-player.php
, find the: function getPlayer
, and w/in that the variable: $playerCode
.
You’ll be inserting code that look something like this PHP/HTML:
'<audio src="' . $source . '" controls>Flash stuff…</audio>'
So, where the original read:
$playerCode = '<p class="audioplayer_container"><span style="display:block;padding:5px;border:1px solid #dddddd;background:#f8f8f8" id="' . $playerElementID . '">' . sprintf(__('Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version <a href="%s" title="Download Adobe Flash Player">here</a>. You also need to have JavaScript enabled in your browser.', $this->textDomain), 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW') . '</span></p>';
Substitute this (we shortened the no-Flash text too):
$playerCode = '<p class="audioplayer_container"><span style="display:block;padding:5px;border:1px solid #dddddd;background:#f8f8f8" id="' . $playerElementID . '">' . sprintf(__('<audio src="' . $source . '" controls><br /><em>Audio player needs Flash9+ (<a href="%s" title="Download Adobe Flash Player">download</a>) and JavaScript.</em>', $this->textDomain), 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW') . '</audio></span></p>';
‘Course, this is a bonehead way to do it, b/c:
- It needs redoing after every upgrade of this plugin.
- We should really should check first to see:
- Does browser supports the html 5 audio tag? (IE8: no.)
- If so, will it play an mp3? (Firefox & Opera: no, Safari & Chrome: yes.)
- Then, according to above conditions, the script should:
- If yes to both, write only the HTML5 audio tag (w/ src), not the Flash stuff.
- If no to either, write only the Flash stuff, not the HTML5. (More info and scripts at HTML 5 Doctor.)
But, for now at least, iPhoney folk can hear us.
Leave a comment: