[wp-trac] [WordPress Trac] #25227: Change relative URL for wp-mediaelement in _wpmejsSettings to absolute

WordPress Trac noreply at wordpress.org
Wed Sep 4 18:18:32 UTC 2013


#25227: Change relative URL for wp-mediaelement in _wpmejsSettings to absolute
---------------------------+-----------------------------------
 Reporter:  RussellYermal  |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Media          |    Version:  3.6
 Severity:  normal         |   Keywords:  2nd-opinion has-patch
---------------------------+-----------------------------------
 Line 305 of wp-includes/script-loader.php reads:


 {{{
         did_action( 'init' ) && $scripts->localize( 'wp-mediaelement',
 '_wpmejsSettings', array(
                 'pluginPath' => includes_url( 'js/mediaelement/' ,
 'relative' ),
         ) );
 }}}

 This works fine when you are hosting WP's js on the same domain, but when
 using a CDN, as many of us are, this causes the [audio] shortcode to try
 to load the swf fallback from:

 http://wp-includes/js/mediaelement/flashmediaelement.swf

 This causes mp3 files embedded with the WP [audio] shortcode not to work
 in firefox when hosting WP's js from a different domain.

 Ideally, the mediaelement-and-player.min.js file can be updated to not
 append http:// to the relative URL, which would result in embedding the
 swf file at /wp-includes/js/mediaelement/flashmediaelement.swf instead of
 http://wp-includes/js/mediaelement/flashmediaelement.swf

 However, to mend this issue in the short term, I've patched script-
 loader.php, line 305, to read:

 {{{
         did_action( 'init' ) && $scripts->localize( 'wp-mediaelement',
 '_wpmejsSettings', array(
                 'pluginPath' => includes_url( 'js/mediaelement/' ),
         ) );
 }}}

 Would love a second opinion here.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25227>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list