WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30029 closed enhancement (fixed)

Allow settings.success override for mediaelement (to give plugins more freedom)

Reported by: michael.heuberger Owned by:
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.1
Component: Media Keywords: has-patch
Focuses: javascript Cc:

Description

This piece in your wp-mediaelement.js file makes it very difficult for me to develop video based WP plugins:

var settings = {};

if ( typeof _wpmejsSettings !== 'undefined' ) {
	settings = _wpmejsSettings;
}

settings.success = function (mejs) {
	...
};

$('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer( settings );

Please change the line

settings.success = function (mejs) {

to

settings.success = settings.success || function (mejs) {

so that I can override it with my own success handler through _wpmejsSettings.

Thanks!

Attachments (1)

30029.diff (480 bytes) - added by nofearinc 5 years ago.
use settings.success if already defined in _wpmejsSettings

Download all attachments as: .zip

Change History (5)

@nofearinc
5 years ago

use settings.success if already defined in _wpmejsSettings

#1 @wonderboymusic
5 years ago

  • Focuses javascript added
  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.1

#2 @wonderboymusic
5 years ago

[30083] missed the ticket

#3 @wonderboymusic
5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

#4 @michael.heuberger
5 years ago

Great! When is 4.1 coming out?

Note: See TracTickets for help on using tickets.