Other plugins rely on Adobe’s displeasing Flash technology. Well hey, so does PlayPress, but PlayPress can fall back or to or from HTML5 audio, so it works on the iPhone and iPad, and it does so without any hacky complications.
It’s so simple, a baby could do it:
For optimal results, you may specify an additional copy of your audio file in Ogg Vorbis format:
[audio mp3="http://example.com/bells.mp3" ogg="http://example.com/bells.ogg"]
(Obviously, you must replace
http://example.com/bells.mp3 with the URL of whatever audio you want to embed.)
New in version 1.2! Optionally, specify a title and/or artist:
[audio mp3="http://example.com/bells.mp3" title="Imagine" artist="John Lennon"]
Here’s an example using a single MP3 file:
Here, I’ve included both Ogg Vorbis and MP3 files:
RSS feed subscribers will get a link to download the audio file, and WordPress’s inbuilt mechanisms should take the necessary steps to add “enclosures” to the feed in the manner of a podcast.
Users of the Jetpack plugin may experience problems. These can be solved by disabling its “Shortcode Embeds” module, “by clicking Learn More and then Deactivate on the module card”. You can use the Jetpack’s many other excellent features just fine.
Some old versions of Opera and Firefox request gzipped Ogg Vorbis files. If these files are served gzipped, they will not play properly.
Amazon S3 may serve these browsers gzipped Ogg Vorbis, so avoid using Amazon S3. But I’m using Amazon CloudFront over here, and it works fine. I don’t understand the world any more.
A file called
htaccess.txt is included in the PlayPress package. If your web host supports this (if in doubt, just try it), put a copy of this file wherever you’re hosting your audio files, and rename it to
.htaccess. This should prevent the problem of Ogg Vorbis gzipping when these browsers naïvely request it.
Thanks to Martin Laine for creating WordPress Audio Player, which is the
player.swf used in this plugin.
Sean Ooi’s Audio For Everybody, itself inspired by Kroc Camen’s Video for Everybody, was an inspiration. His suggested markup includes references to Windows Media Player and QuickTime – I’ve chosen to avoid that can of worms for now.