PlayPress
PlayPress is a JavaScript-free, low-Flash audio player plugin for WordPress, fortified with HTML5. “Free as in beer, speech and fat.”
Get PlayPress from the WordPress plugin repository
Lightweight
Some WordPress audio plugins inject JavaScript into every page of your website, even pages that don’t have any audio on them. PlayPress doesn’t need any JavaScript to work.
HTML5
Other plugins rely on Adobe’s proprietary Flash technology. So does PlayPress, but with the important distinction that it can fall back or to or from standard HTML5 audio, so it works on the iPhone and iPad.
How to use
Just put this where you want the audio player to be:
[audio mp3="http://example.com/bells.mp3"]
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"]
Output
Here’s an example using a single MP3 file:
- If you have Flash installed, you’ll see a Flash audio player.
- If not, you’ll see an HTML5 audio player – but it won’t work in Firefox or Opera.
- If not, you’ll see a link to download the audio file.
Here, I’ve included both Ogg Vorbis and MP3 files:
- If your browser supports HTML5 audio, you’ll see its native audio player.
- If not, but Adobe Flash Player is installed, you’ll see a Flash audio player.
- If not, you’ll see a link to download the audio file.
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.
Get PlayPress from the WordPress plugin repository
Troubleshooting
- Users of the Jetpack plugin may experience problems if the “Shortcode Embeds” module is enabled. The module can be disabled by going to
/wp-admin/admin.php?page=jetpack
, finding the box entitled “Shortcode Embeds”, and clicking “Learn More” and then “Deactivate”. Some old versions of Opera and Firefox request gzipped (compressed) versions of Ogg Vorbis files. If your web server serves these files gzipped, they will not play properly.
A file called
htaccess.txt
is included in the PlayPress package. If your web server supports this (i.e. it’s Apache with mod_rewrite) (if you’re not sure, it’s worth a try), copy this file to wherever you’re hosting your audio files (probably/wp-content/uploads/
), and rename it to.htaccess
.
Credits
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.