[wp-trac] [WordPress Trac] #26631: Add a "playlist" shortcode
WordPress Trac
noreply at wordpress.org
Fri Jan 10 05:16:33 UTC 2014
#26631: Add a "playlist" shortcode
-------------------------------------------------+-------------------------
Reporter: wonderboymusic | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 3.9
Component: Media | Version:
Severity: normal | Resolution:
Keywords: needs-testing has-patch needs-ui |
needs-docs needs-unit-tests |
-------------------------------------------------+-------------------------
Changes (by wonderboymusic):
* keywords: => needs-testing has-patch needs-ui needs-docs needs-unit-
tests
* milestone: Future Release => 3.9
Comment:
Updated the patch with latest progress:
* Abstracts `wp.media.gallery` code in `wp.media.collection` which
`wp.media.gallery`, `wp.media.playlist`, and `wp.media['video-playlist']`
use.
* Abstracts `wp.media.controller.GalleryAdd` and
`wp.media.controller.GalleryEdit` into `wp.media.controller.CollectionAdd`
and `wp.media.controller.CollectionEdit` which all 3 use with minimal
registration code
* Allows any new types/shortcodes to be simply added by convention with a
few lines of code, the only excessive code is registering new Toolbars and
Menus when you add a new type, there really isn't any way around it
* Adds TinyMCE view switch for `[playlist]` and `[video-playlist]` using
the `wpplaylist` plugin, which I added. Theoretically, all media
shortcodes could use the same TinyMCE plugin - all it does it turn a
shortcode into HTML and the reverse. Adding another plugin each time seems
excessive.
* Abstracts the shortcode handlers for `[playlist]` and `[video-playlist]`
into one helper function:
{{{
function wp_playlist_shortcode( $attr ) {
return wp_get_playlist( $attr, 'audio' );
}
add_shortcode( 'playlist', 'wp_playlist_shortcode' );
function wp_video_playlist_shortcode( $attr ) {
return wp_get_playlist( $attr, 'video' );
}
add_shortcode( 'video-playlist', 'wp_video_playlist_shortcode' );
}}}
The player on the front end will use a `MediaElementPlayer` object and
some custom Backbone Views. The ME class is necessary to control the
player from code and sequence tracks / support next-prev, etc. Next steps
will be skinning the audio player to show metadata and images.
This code actually works now - audio and video, all clips will play one
after the other.
Gonna shoot for this or something like it in 3.9.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26631#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list