Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#40750 closed defect (bug) (fixed)

Widgets: MediaElement.js player for audio widget sporadically fails to initialize

Reported by: westonruter's profile westonruter Owned by: westonruter's profile westonruter
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.8
Component: Widgets Keywords: has-patch
Focuses: Cc:


As reported via @melchoyce in

Sometimes the volume control doesn't initially appear but then appears after resize:

The issue seems to be that the player doesn't initialize with the right dimensions when the widget control is slideDown()ing. Resizing the window then seems to cause the player to snap into the right place.

We should also consider using ME.js for the video widget since we're using it for the audio widget.

Attachments (1)

40750.0.diff (2.1 KB) - added by westonruter 7 years ago.

Download all attachments as: .zip

Change History (6)

7 years ago

#1 @westonruter
7 years ago

  • Keywords has-patch added

40750.0.diff is a fix which replicates the same logic implemented for the Text widget. TinyMCE fails to initialize properly when the widget is not fully expanded, and it seems ME.js has the same problem. So this patch defers rendering the widget until its container is done animating.

Ideally there would be an event we could listen for the completion of the :animated state, but unfortunately it seems jQuery does not provide this.

This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.

7 years ago

#4 @westonruter
7 years ago

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

In 40656:

Widgets: Defer rendering controls for media widgets until container element fully expands.

Fixes issue with MediaElement.js failing to build the player in an animating container that doesn't have established dimensions.
Also utilizes MediaElement.js for the video widget instead of using a native player.

See #32417.
Fixes #40750.

#5 @westonruter
7 years ago

In 40660:

Widgets: Fix deferred rendering of controls for media widgets until container element fully expands.

Adds omitted call to renderWhenAnimationDone() which was missed when this code was copied from the Text widget.

Amends [40656].
See #40750.

Note: See TracTickets for help on using tickets.