[wp-trac] [WordPress Trac] #30850: Audio/video previews for media controls in the Customizer

WordPress Trac noreply at wordpress.org
Wed Feb 11 13:03:33 UTC 2015


#30850: Audio/video previews for media controls in the Customizer
------------------------------+-------------------------
 Reporter:  celloexpressions  |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  4.2
Component:  Customize         |     Version:  4.1
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch       |     Focuses:  javascript
------------------------------+-------------------------

Comment (by Fab1en):

 I played a bit with @celloexpressions [attachment:30850.diff patch], and I
 found two issues :
   1. When the customizer is loaded with a media already present in the
 Upload control, mediaelement.js already handles it. So calling
 `mediaelementplayer` again breaks it.
   2. When `mediaelementplayer` is first run, the section is closed so the
 player inside the control is not visible. This causes the player control
 bar width to be set to a wrong value. `setControlsSize` mediaelement
 method should be called as soon as the player is made visible to restore
 the right control bar width

 I have modified the patch to correct both issues, but I was not able to
 find the proper events to bind into. I put a 5s delay, so if you open the
 section where upload control is within 5s after loading, it works.

 Is there an event that is triggered upon section opening, so that I can do
 something like

 {{{
 control.section().on( 'open', function() { /* do something */ } );
 }}}

 ?

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


More information about the wp-trac mailing list