Tags

Archive

As mentioned in a previous post, the “Total Education Conversations” podcast page now incorporates inline audio players so that users can click a button and play the podcast without having to download a file first. Much easier for the non-technical user.

Initially I used the “audiojs” player, but is no longer in active development and was incompatible with recent versions of jQuery. It required a special header in the page template which referenced an earlier version of jQuery.

But that wasn’t the only problem.

These inline players use the HTML5 <audio> tag. The <audio> tag supports the specification of multiple source formats for an audio program. Why are these necessary? Because different browsers support different audio file formats. You would think that mp3 would be a universal standard. Not so. There are copyright issues which get in the way apparently.

So we have the situation where Safari and Chrome (both webkit based) handle mp3, as does Internet Explorer 9 and newer. But the open source Firefox browser, quite widely used, does not. Instead it requires the Ogg Vorbis audio file format.

So it became necessary to create two versions of each podcast: mp3 and ogg. Not a problem.

This all worked pretty well when the audio files were uploaded to Business Catalyst as plain old files in the file system. But downloads of plain old files are not included in Business Catalyst’s web stats. For this you are expected to use “Media Downloads”.

To cut a long story short, I soon discovered that Media Downloads in Business Catalyst do not behave in the same way as normal file downloads. They were not working correctly with the audio player:

The duration was being displayed as NaN. Floating point calculations such as divide by zero yield a NaN result. This did not look good.

Secondly, seeking by clicking on the “timeline” in the player did not work. The audio just kept on playing, so you couldn’t “rewind” or “fast forward” the podcast.

The player would sometimes stall after a few minutes.

To top it off, Business Catalyst would not serve the correct “mime type” file extension for Ogg Vorbis files, which caused the audio player to consider the file as “Not Found”.

After spending hours experimenting with this and submitting bug reports to Business Catalyst, I decided to switch to serving the audio files from Amazon S3 instead of Business Catalyst.

At the same time I switched to the “MediaElement” audio player, which is still in active development.

The combination of serving the files from S3, together with the MediaElement audio player turned out to work perfectly. S3 is more configurable than Business Catalyst, and S3 keeps log files which we can analyse at a later date. I’m building a custom Ruby script to do this which will provide us exactly the kind of stats report we need.