Media: add a filter, `'mejs_settings'`, to allow devs to pass more config settings to MediaElement.

Fixes #33506.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-18 20:00:27 +00:00
parent c6c9f8ad26
commit abefb963e7
2 changed files with 13 additions and 3 deletions

View File

@ -351,9 +351,19 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.js", array('mediaelement'), false, 1 );
did_action( 'init' ) && $scripts->localize( 'mediaelement', '_wpmejsSettings', array(
$mejs_settings = array(
'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ),
) );
);
did_action( 'init' ) && $scripts->localize( 'mediaelement', '_wpmejsSettings',
/**
* Filter the MediaElement configuration settings.
*
* @since 4.4.0
*
* @param array $mejs_settings MediaElement settings array.
*/
apply_filters( 'mejs_settings', $mejs_settings )
);
$scripts->add( 'froogaloop', "/wp-includes/js/mediaelement/froogaloop.min.js", array(), '2.0' );
$scripts->add( 'wp-playlist', "/wp-includes/js/mediaelement/wp-playlist.js", array( 'wp-util', 'backbone', 'mediaelement' ), false, 1 );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34310';
$wp_version = '4.4-alpha-34311';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.