Make WordPress Core

Changeset 24940


Ignore:
Timestamp:
08/01/2013 01:15:14 PM (12 years ago)
Author:
nacin
Message:

Pass pluginPath to MediaElement.js, fixing playback when ME.js is served through load-scripts.php.

props ocean90, wonderboymusic, azaozz.
fixes #24902.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/mediaelement/wp-mediaelement.js

    r23729 r24940  
    44    mejs.plugins.silverlight[0].types.push('audio/x-ms-wma');
    55
    6     $(function () {
    7         $('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer();
     6    $(function () {
     7        var settings = {};
     8
     9        if ( typeof _wpmejsSettings !== 'undefined' )
     10            settings.pluginPath = _wpmejsSettings.pluginPath;
     11
     12        $('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer( settings );
    813    });
    914
  • trunk/wp-includes/link-template.php

    r24844 r24940  
    20212021 *
    20222022 * @param string $path Optional. Path relative to the includes url.
     2023 * @param string $scheme Optional. Scheme to give the includes url context.
    20232024 * @return string Includes url link with optional path appended.
    20242025*/
    2025 function includes_url($path = '') {
    2026     $url = site_url() . '/' . WPINC . '/';
     2026function includes_url( $path = '', $scheme = null ) {
     2027    $url = site_url( '/' . WPINC . '/', $scheme );
    20272028
    20282029    if ( $path && is_string( $path ) )
  • trunk/wp-includes/script-loader.php

    r24786 r24940  
    303303
    304304    $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.js", array('mediaelement'), false, 1 );
     305    did_action( 'init' ) && $scripts->localize( 'wp-mediaelement', '_wpmejsSettings', array(
     306        'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ),
     307    ) );
    305308
    306309    $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.