Archive for the ‘PHP’ Category

 

A short excursion into code

Saturday, June 30th, 2012

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)

Remember to Create Daily

Friday, May 25th, 2012

Last session, I started well but fell away from The Daily Create I want to have a better track record this time. So far, 5 days in I’ve managed to keep up, albeit by using one video to do two days.

I follow @DS106TDC but the tweets are lost in the stream.

I though I might try to make a wee reminded web app from my iPhone. This is pretty simple, I just made a webpage, that grabs the latest item from the daily create RSS feed (I think I am using the atom one). I just show the title as a link to the page. The page has the various meta tags to play nicely with the iphone and looks like this:

The above pulls the page into an iFrame with an iPhone background graphic, so should show todays page.

I then added a splash screen and an icon, so that I could save the webpage to my home screen:

Should do the trick, if any other ds106 folk would find this useful just visit: http://johnjohnston.info/tdc/ on your iphone and add to the home screen.

If anyone want to make me a better icon, please do.