﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses	prnumber
42189	MediaElement.js 4.2 is not backward compatible with 2.2	bradyvercher	westonruter	"It looks like a lot of work has gone into modernizing and improving the codebase for the new version of MediaElement.js, but backward compatibility doesn't really seem to have been a major consideration.

Here are a few issues I've run across over the past few days while trying to prepare our themes and plugins:

ME.js has its own API for writing plugins, which is how it builds its own UI, however the API for this changed in 4.x. This is a basic callback for a new feature:

{{{
MediaElementPlayer.prototype.buildfeaturename = function( player, controls, layers, media ) {

};
}}}

In MediaElement.js 2.x, `controls`, `layers`, and `media` are all jQuery objects, but 4.x dropped the jQuery requirement, so those are now HTML elements. Any code that expects the jQuery objects now breaks. There are also various public properties on the `player` object that were jQuery objects that have been replaced or removed.

All HTML classes were prefixed with `mejs-` in 2.x. The latest version requires setting the new `classPrefix` option to `mejs-` to maintain backward compatibility. That's fine for the core players, but as soon as users upgrade WordPress before their theme or plugins that relied on the old behavior, they'll have broken media players.

Various global utiliies were also renamed, which breaks compatibility in scripts that were relying on them. For instance, `mejs.MediaFeatures` was renamed to `mejs.Features` and `mejs.Utility` is now `mejs.Utils`.

The styles and HTML structure for players have also changed.

With all these changes, there really isn't a way to prevent issues for users who don't upgrade their themes and plugins before WordPress.

We're prepared to handle the support burden and I generally approve of all the improvements in the new version of MediaElement.js, but with all the data type and API changes, it's basically a new library, so I thought I'd raise these concerns now in case anyone else is having similar issues."	defect (bug)	closed	normal	4.9	Media	4.9	major	fixed	has-patch commit			
