A short excursion into code

A few posts/couple of weeks ago I installed the oEmbed HTML5 audio plugin here. This allows me to upload mp3s and other audio files, the plugin takes care of presenting the audio using the html5 audio tag with a flash fallback for browsers that do not support the type of audio: This plugin converts URLs to audio files (MP3, OGG, WAV) into HTML5 audio with Flash-based player backup
This seemed to do the trick. This morning I noticed that none of my audio was showing in FireFox. I right clicked on the space where I expected to see the player and saw the the Flash file was not loaded.

Looking at the source it seems that it is using a swf file belonging to google:
http://www.google.com/reader/ui/3523697345-audio-player.swf

and that is Error 400 Not found.

Using Cyberduck I had a look at the plugin’s code.  Part of this check to see if the file is an MP3 and the browser FireFox. firefox does not support playing of MP3 via the audio tag so the plugin uses the google Flash file, which is of course missing.
$embed = sprintf( '<embed type="application/x-shockwave-flash" flashvars="audioUrl=%1$s" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27" quality="best"></embed>', esc_attr($matches[0]) );
On my ‘real’ blog I usually embed audio using dewplayer so I decided to edit the plugin to use that.

I uploaded the dewplayer.swf file to the top level of my site and changed the code, I need to change the name of the var from audioUrl to mp3 and the url of the google swf to /dewplayer.swf.

If you are viewing any of my audio posts in fireFox you should hopefully be less puzzled.

Update: the plugin has been updated: WordPress › oEmbed HTML5 audio « WordPress Plugins

1.1

  • Google removed their MP3 Flash player from their website, so we include it in the plugin itself now (it’s still the same player)