Audio / Video 2.0 Update – Playlists

Previously: http://make.wordpress.org/core/2014/01/29/audiovideo-2-0-update/

It has been a slow and steady burn of commits related to media and necessary for playlists:
[27059], [27063], [27907], [27100], [27127], [27209], [27212], [27213], [27214], [27215]

A few items for conversation….

Thumbnails for Audio and Video

We have been parsing the ID3 tags in audio and video files on upload since 3.6. ID3 tags, in many cases, contain the binary bits for an image related to the item (album cover, still, etc). On upload, if your theme and the relevant pseudo post type for attachment:audio or attachment:video registered support for thumbnails AND your current theme supported it, we would upload the image bits and attach to the media item as its featured image.

So basically it was a hidden feature, because it required you to jump through hoops to turn it on.

add_post_type_support( 'attachment:audio', 'thumbnail' );
add_post_type_support( 'attachment:video', 'thumbnail' );
add_theme_support( 'post-thumbnails', array( 'post', 'attachment:audio', 'attachment:video' ) );

On top of that, if you switch themes, and the theme doesn’t support thumbnails for audio or video, the images will no longer appear alongside the media on the Edit Media page. Weird.

Playlists are best enjoyed with images, videos are best enjoyed with poster images. Soundcloud is doing some awesome things with images in their embeds – see a few on the homepage here: http://highforthis.com. Moral of the story: I think this support should be on by default. Alternately, we could add that code to every default theme’s functions.php, but then what if you switch themes…

Playlist UI

As I mentioned previously, the UI for playlists needs to be:
1) Adaptable
2) Extensible
3) Generic

Translation: it needs to show up in a theme without much drama, inherit the style of the theme, respond the theme’s $content_width, all while allowing you to completely override this behavior. So, what I have is an ultra generic design controlled by settings in the media modal:

Playlist Settings
I have tested this in the last 5 default themes:

Twenty Fourteen

Screen Shot 2014-02-20 at 3.47.59 PM

Twenty Thirteen

Screen Shot 2014-02-20 at 3.48.58 PM

Twenty Twelve

Screen Shot 2014-02-20 at 3.49.22 PM

Twenty Eleven

Screen Shot 2014-02-20 at 3.50.10 PM

Twenty Ten

Screen Shot 2014-02-20 at 3.50.49 PM
I would like to drop this code in soon, but I wanted to give an opportunity for feedback. All of this can easily be iterated upon once it goes in.

Documentation of 3.5 Media Code

This is ongoing – there has been a lot of code churn in the Backbone code, by myself and others, I’ll be picking this back up once that settles down.