Generate playlists automatically from mp3s attached to your post/page
Audio support in WordPress makes me cry. No native player, the fields in the Media library are just wrong, and let’s not get into ID3 tag support. The audio shortcode and player provided by Jetpack is a step in the right direction. However, the ability to directly create a player or playlist on a post/page from attached mp3s makes me sad again. Writing that shortcode is nasty business for anything beyond a file or two.
For example of said nastiness, take a look at the docs (obviously slanted towards wordpress.com users): http://en.support.wordpress.com/audio/
When inserting into a post, make sure to click the None button for Link URL and then click the Insert into Post button (as illustrated in the image below). If your file is an mp3 file, this will insert the audio player shortcode into your post or page.
Nope! Doesn’t work if you’re hosting your own installation of WP. And what about the [gallery] shortcode for images? So easy to round up all your attached pictures and display them all automagically. Again, no love for audio.
This plugin acts as a wrapper for Jetpack’s [audio] shortcode. It rounds up all the mp3s attached to your post/page and adds them as a playlist in the Jetpack player. Simply attach your mp3s to your post/page and use the shortcode [[jplaylist] where you want your playlist. You can also print a playlist, add links, randomize the tracks and add a pop-up button. You can still use all the options from the vanilla [audio] shortcode.
Installation and Usage:
- Upload the plugin, either via ftp or the Plugin-in dash.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- Bulk upload and attach mp3s to your post via the “Add Audio” or “Add Media” button, but do not insert them.
- Order mp3s in “Gallery” tab.
- Use the [jplaylist] shortcode to display a playist of all the mp3s attached to your page/post
Walkthrough (updated for new Media Uploader):
This player generated from the mp3’s I attached to this page. No messy [audio] shortcode was written: honest!
Shortcode [jplaylist bgcolor=0xEAEAEA] produces:
=How do I order the songs in the playlist?=
Click on “Add Audio”. Go to “Gallery”. Drag and drop your mp3s into the order you want (it ignores images and other crap). The plugin goes by ascending order.
= How do I change the title and artist info for a mp3? =
Song title corresponds to the “Title” field, and song artist corresponds to the, um, “Caption” field (I know this makes not a ton of sense, but I’m working with what I’m given, folks. I may have the plugin change this field title in a future release). WordPress makes a guess as to the title of the mp3 when you upload it. I recommend you change this info as soon as you upload inside the post/page. You can also change this in the media library.
= What about other audio formats than mp3? =
Sorry, other audio formats aren’t supported by Jetpack’s player.
= What about accessing the player options (color, size, etc)? Can I do that? =
Yes! You can use any of those options. You can either use the janky pipe (|) method to connect everything like you’re told to with the [audio] shortcode, or you can use proper attributes.
[jplaylist bgcolor=”0x000000″ lefticon=”0x00ff00″ righticon=”0xFF0000″ animation=”no” loop=”yes”]
= Can I make playlists from attachments on other pages? =
Yah. You use the “pid” attribute with a post/page id or permalink slug.
= How do I turn on “list mode?” =
Use [jplaylist print=”ol”] for an ordered list, [jplaylist print=”ul”] for an unordered one.
= How do I make my playlist have links? =
Turn on list mode and then use
= How do I turn on “random mode?” =
Use [jplaylist random=’true’] for random song ordering. This is per page load.
= How do I add a pop-up button =
Use [jplaylist external=”true”] for a window with the dimensions 350×500. If you want to customize the dimensions, then use a comma separated width and height, like [jplaylist external=”600,800″]. The playlist window will use the title of your post/page. It will also be linked to your default theme stylesheet so you can make it pretty. I leave it to the user to suss out the page structure of the pop-up.
You can, of course, combine all these options!
= Can you support my favorite player WordPess player plugin xyz? =
Maybe! You can talk to me about it at least.
= I’m hitting an upload limit. Help! =
Welp, that’s nothing to do with the plugin or even WordPress. You can edit (or create) the php.ini file in your root directory to tweak this. Better yet, contact your host re: increasing your upload size. Hint.