Commit Graph

19 Commits

Author SHA1 Message Date
Weston Ruter
1829a2ce27 Customize: Ensure media playlists get initialized after selective refresh; expose new wp.playlist.initialize() API.
In particular allows audio and video playlists to be added to the Text widget and previewed.

Props bpayton, westonruter.
See #40854.
Fixes #42495.

Built from https://develop.svn.wordpress.org/trunk@42613


git-svn-id: http://core.svn.wordpress.org/trunk@42442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-01-29 23:56:29 +00:00
atimmer
1f707de9dd Docs: Improve wp-admin JSDoc structural data globally.
JSDoc takes it structural data from `@namespace`, `@lends` and `@memberOf`. This change fixes these tags for all JavaScript files in the wp-admin folder.

* Add jsdoc configuration to parse wp-admin/js files. Use `jsdoc -c jsdoc.conf.json` to generate JSDoc.
* Define all used namespaces using `@namespace`.
* Define each usage of the extend function as a prototype assignment using `@lends`.
* Add `@alias` if JSDoc cannot detect the correct name automatically.

This has previously been corrected for all `wp-includes` JavaScript files: [41351].

Props herregroen.
Fixes #42485.

Built from https://develop.svn.wordpress.org/trunk@42403


git-svn-id: http://core.svn.wordpress.org/trunk@42232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-12-15 13:42:46 +00:00
Dominik Schilling
dc6a3284e8 Media: JSHint for wp-playlist.js.
File was added to the watchlist in [36780].

See #35984.
Built from https://develop.svn.wordpress.org/trunk@36783


git-svn-id: http://core.svn.wordpress.org/trunk@36750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-29 21:50:27 +00:00
Scott Taylor
cee318ed81 Media: When reusing the initial values from the global MediaElement config object, the config object should first be cloned. Objects in JS are references that will retain any changes. This fixes an issue where player controls could get mixed up between instances when multiple players (namely, single audio and audio playlists, in a certain order) are on the same page.
Props Fab1en.
Fixes #34152.

Built from https://develop.svn.wordpress.org/trunk@36364


git-svn-id: http://core.svn.wordpress.org/trunk@36331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-01-20 15:47:28 +00:00
Andrew Ozz
703b625820 Media: add a class to the <script> tag for the JSON encoded playlist data so it can be easily selected in WPPlaylistView. Props SergeyBiryukov, fixes #29383
Built from https://develop.svn.wordpress.org/trunk@29660


git-svn-id: http://core.svn.wordpress.org/trunk@29434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-09-01 19:55:18 +00:00
Scott Taylor
cb2d88a092 After [29179], remove the last instance of this.isCompatibleSrc().
Props kovshenin.
See #28905.


Built from https://develop.svn.wordpress.org/trunk@29277


git-svn-id: http://core.svn.wordpress.org/trunk@29059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-23 17:54:15 +00:00
Scott Taylor
93fdff3581 Simplify creation of audio, video, and playlist MCE views by placing them in iframe sandboxes.
Wins:
* Eliminates duplication of code between PHP and JS
* Views can load JS without messing with TinyMCE and scope
* MEjs doesn't break when it loads a file plugin-mode. This allows any file type the MEjs supports to play in MCE views.
* YouTube now works as the source for video.
* Users can still style the views, editor stylesheets are included in these sandboxes.
* Audio and Video URLs and `[embed]`s are no longer broken.
* Remove the crazy compat code necessary to determine what file types play in what browser.
* Remove unneeded Underscore templates.
* Remove the compat code for playlists.

See #28905.

Built from https://develop.svn.wordpress.org/trunk@29179


git-svn-id: http://core.svn.wordpress.org/trunk@28963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-15 22:18:14 +00:00
Scott Taylor
4fd5ffe994 In WPPlaylistView::ended(), at the end of a playlist, set the index to 0 and call ->setCurrent() instead of ->loadCurrent() so that the first track is properly highlighted.
Fixes #28428.

Built from https://develop.svn.wordpress.org/trunk@28649


git-svn-id: http://core.svn.wordpress.org/trunk@28467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-06-02 00:27:18 +00:00
Scott Taylor
aeadf0c7cf Allow users to set overrides for MediaElement instances by always passing _wpmejsSettings instead of just _wpmejsSettings.pluginPath.
Props Otto42 for the initial patch.
Fixes #25243.


Built from https://develop.svn.wordpress.org/trunk@28370


git-svn-id: http://core.svn.wordpress.org/trunk@28198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-11 06:25:15 +00:00
Scott Taylor
fd65d355a2 Add a compatibility layer in wp-playlist.js to avoid VM errors from MediaElement's plugin bridge in the TinyMCE views for playlists by suppressing playback for files whose mime-type is not supported in the user's browser natively.
This is similar to how audio and video shortcodes are handled: file types are whitelisted for native playback.

See #27892.


Built from https://develop.svn.wordpress.org/trunk@28171


git-svn-id: http://core.svn.wordpress.org/trunk@28002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-20 03:53:15 +00:00
Scott Taylor
b7b2f53aa4 Don't set the poster image for videos in a playlist if the image is the video mime-type icon blown up.
See #27892.


Built from https://develop.svn.wordpress.org/trunk@28158


git-svn-id: http://core.svn.wordpress.org/trunk@27989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-18 17:39:15 +00:00
Andrew Nacin
e3a4c57563 Final about page.
props melchoyce, helen, wonderboymusic, nacin, and the illustrious Michael Pick.
fixes #27713, #27837.

Built from https://develop.svn.wordpress.org/trunk@28150


git-svn-id: http://core.svn.wordpress.org/trunk@27981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-16 17:40:14 +00:00
Scott Taylor
42a66ea424 Make playlist tracks keyboard-accessible.
Fixes #27644.


Built from https://develop.svn.wordpress.org/trunk@28023


git-svn-id: http://core.svn.wordpress.org/trunk@27853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-07 22:28:16 +00:00
Scott Taylor
6ec61c7506 Call MediaElement's shim method for setSrc() when dynamically updating the playing source in playlists, which will properly set the source for mobile.
Make the labels for playlist items slightly smaller to account for size on mobile.

Fixes #27625.


Built from https://develop.svn.wordpress.org/trunk@27895


git-svn-id: http://core.svn.wordpress.org/trunk@27726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-01 19:04:14 +00:00
Scott Taylor
55b61b7a70 Re-instantiate the MediaElementPlayer instance when switching mime types in playlists.
Fixes #27608.


Built from https://develop.svn.wordpress.org/trunk@27871


git-svn-id: http://core.svn.wordpress.org/trunk@27702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-31 15:35:15 +00:00
Scott Taylor
615dd5331b Unifying media controls and supporting playlists in the editor:
* Support a `caption` attribute for audio and video shortcodes
* In `wp.media.audio|video`, rename `update` to `shortcode` to allow these models to share the same mixins as `wp.media.collection` subclasses
* When sending an audio or video shortcode to the editor, create a default caption if the user hasn't entered one. This currently only displays in the editor, not on the front end. Captions aren't tied to a specific attachment here because external sources are supported.
* In the `wp.mce.media` mixin, in the `edit` method, read `attr` instead of `data` when attempting to parse the encoded shortcode. `data` does not automatically update when the attribute changes. This was a blessing to debug.
* Add `wp.mce.media.PlaylistView` to support playlist views in TinyMCE
* Expose `WPPlaylistView` to global scope and suppress auto-parsing of playlist nodes when in the admin. Allow `WPPlaylistView` to be passed `metadata` on creation instead of requiring a JSON blob to be parsed.
* Remove all of the playlist logic from the `wpgallery` TinyMCE plugin.
* In `wp_prepare_attachment_for_js()` return more data for audio/video so that playlists can have parity in the admin/front end.

See #27320.


Built from https://develop.svn.wordpress.org/trunk@27640


git-svn-id: http://core.svn.wordpress.org/trunk@27483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-20 13:33:14 +00:00
Scott Taylor
394feb8f91 Add a class, wp-playlist-playing, to the currently loaded track when tracks are displayed. Add some subtle styles for light and dark playlist themes.
See #27321.


Built from https://develop.svn.wordpress.org/trunk@27489


git-svn-id: http://core.svn.wordpress.org/trunk@27333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-10 00:15:14 +00:00
Scott Taylor
db1a8785b5 Some playlist cleanup:
* Check properties against the `window` object when using `_.isUndefined()` on globals
* Fix a typo for `$safe_type` introduced in [27311]

See #26631.


Built from https://develop.svn.wordpress.org/trunk@27320


git-svn-id: http://core.svn.wordpress.org/trunk@27172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-27 21:38:17 +00:00
Scott Taylor
943f295d2e Add core support for Playlists and Video Playlists.
* Playlists operate like galleries in the admin. 
* Provide default UI and JS support in themes using MediaElement and Backbone. 
* The shortcodes are clickable, editable, and configurable using the media modal. 
* Playlists support images for each item, whether or not the current theme supports images for `attachment:audio` and `attachment:video`
* Playlists respond to `$content_width` and resize videos accordingly.
* All playlist data is included inline, using a script tag with `type="application/json"`, allowing anyone to unenqueue the WP playlist JS and roll their own.
* Playlist styles are minimal and work out of the box in the last 5 default themes. They inherit and adapt to the current theme's font styles, and their rules are easily overrideable.

See #26631.


Built from https://develop.svn.wordpress.org/trunk@27239


git-svn-id: http://core.svn.wordpress.org/trunk@27096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-24 18:08:16 +00:00