[wp-trac] [WordPress Trac] #42189: MediaElement.js 4.2 is not backward compatible with 2.2

WordPress Trac noreply at wordpress.org
Fri Oct 13 15:29:47 UTC 2017


#42189: MediaElement.js 4.2 is not backward compatible with 2.2
--------------------------+-----------------------
 Reporter:  bradyvercher  |       Owner:  rafa8626
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  4.9
Component:  Media         |     Version:  trunk
 Severity:  major         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------

Comment (by bradyvercher):

 @rafa8626 There are still a few references to `player.container` in some
 of the features. I noticed them in at least progress, tracks, and volume.

 For registering the migration script, I think you can look to how jQuery
 migrate is handled:

 {{{
 $scripts->add( 'mediaelement', false, array( 'jquery', 'mediaelement-
 core', 'mediaelement-migrate' ), '4.2.6-44f2e99' );
 $scripts->add( 'mediaelement-core', "/wp-includes/js/mediaelement
 /mediaelement-and-player$suffix.js", array(), '4.2.6-44f2e99', 1 );
 $scripts->add( 'mediaelement-migrate', "/wp-includes/js/mediaelement
 /mediaelement-migrate$suffix.js", array('mediaelement'), false, 1 );
 }}}

 Doing it that way should ensure the migration script is always enqueued
 after `mediaelement-and-player.js`. The formatting in `mediaelement-
 migrate.js` doesn't match WP's coding standards, so I'm not sure if that's
 something you want to take on, or leave to someone else.

 I also came across another method that's been moved and can be added to
 the migration script:

 {{{
 mejs.HtmlMediaElementShim = mejs.HtmlMediaElementShim || {
         getTypeFromFile: mejs.Utils.getTypeFromFile
 };
 }}}

 I'm still not sure about every element in the `layers` div receiving an
 inline width of 100%. I've tried setting `stretching: none` and they still
 receive that attribute. I've traced it down to the `setDimensions()`
 method, which appears to apply an inline width on layers no matter the
 stretching mode. Disabling `setDimensions` seems to help, but I'm not sure
 if that can be done as a default.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42189#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list