Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 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:

Description

As reported via @melchoyce in https://wordpress.slack.com/archives/C0381N237/p1494608916089518

https://cldup.com/HVbLFbjVDR.png

Sometimes the volume control doesn't initially appear but then appears after resize: https://cloudup.com/cf0-jpXGDCX

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 8 years ago.

Download all attachments as: .zip

Change History (6)

@westonruter
8 years ago

#1 @westonruter
8 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.


8 years ago

#4 @westonruter
8 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
8 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.