WordPress.org

Make WordPress Core

Changeset 24941 for branches/3.6


Ignore:
Timestamp:
08/01/2013 01:18:01 PM (8 years ago)
Author:
nacin
Message:

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

Merges [24940] to the 3.6 branch.

props ocean90, wonderboymusic, azaozz.
fixes #24902.

Location:
branches/3.6
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/3.6

  • branches/3.6/wp-includes/js/mediaelement/wp-mediaelement.js

    r23729 r24941  
    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
  • branches/3.6/wp-includes/link-template.php

    r24783 r24941  
    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 ) )
  • branches/3.6/wp-includes/script-loader.php

    r24786 r24941  
    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.