diff --git a/wp-includes/js/mediaelement/wp-mediaelement.js b/wp-includes/js/mediaelement/wp-mediaelement.js index c162128e02..fb09e3cde3 100644 --- a/wp-includes/js/mediaelement/wp-mediaelement.js +++ b/wp-includes/js/mediaelement/wp-mediaelement.js @@ -3,8 +3,13 @@ mejs.plugins.silverlight[0].types.push('video/x-ms-wmv'); mejs.plugins.silverlight[0].types.push('audio/x-ms-wma'); - $(function () { - $('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer(); + $(function () { + var settings = {}; + + if ( typeof _wpmejsSettings !== 'undefined' ) + settings.pluginPath = _wpmejsSettings.pluginPath; + + $('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer( settings ); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 351d64a13a..5fb61726fb 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -2020,10 +2020,11 @@ function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) { * @since 2.6.0 * * @param string $path Optional. Path relative to the includes url. + * @param string $scheme Optional. Scheme to give the includes url context. * @return string Includes url link with optional path appended. */ -function includes_url($path = '') { - $url = site_url() . '/' . WPINC . '/'; +function includes_url( $path = '', $scheme = null ) { + $url = site_url( '/' . WPINC . '/', $scheme ); if ( $path && is_string( $path ) ) $url .= ltrim($path, '/'); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index ee135dde78..57b8278ffd 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -302,6 +302,9 @@ 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( 'wp-mediaelement', '_wpmejsSettings', array( + 'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ), + ) ); $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), false, 1 ); did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', array(