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

Fixes #33506.


git-svn-id: https://develop.svn.wordpress.org/trunk@34311 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-09-18 19:59:43 +00:00
parent 2fd81992bc
commit a5f62a6cd5

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 ); $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' ), '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( '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 ); $scripts->add( 'wp-playlist', "/wp-includes/js/mediaelement/wp-playlist.js", array( 'wp-util', 'backbone', 'mediaelement' ), false, 1 );