Change relative URL for wp-mediaelement in _wpmejsSettings to absolute
|Reported by:||RussellYermal||Owned by:|
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:
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.
Change History (7)
comment:1 SergeyBiryukov — 8 months ago
- Keywords has-patch removed
- Milestone changed from Awaiting Review to 3.7