Make WordPress Core

Opened 7 years ago

Last modified 4 years ago

#43736 new defect (bug)

Audio continues to play in Media Modal after close

Reported by: bahia0019's profile bahia0019 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.5
Component: Media Keywords:
Focuses: Cc:

Description

When previewing an audio file in the Media Library modal, if you click Close or Escape, the audio continues to play.
I haven't tested with Video, but I am assuming audio continues as well.

Change History (3)

#1 @bahia0019
7 years ago

I couldn't figure out how to properly diff the SVN I checked out, but my patch is:

Adding the following to wp-includes/js/media-views.js line 4399.

$('.wp-media-wrapper').remove();

#2 @adamsilverstein
7 years ago

@bahia0019 Thanks for the bug report and proposed fix! I'll take a look.

Please note that you can now use git instead of svn when creating patches, perhaps that will make it easier for you? https://make.wordpress.org/meta/handbook/documentation/contributing-with-git/. Another alternative is using our grunt patch command: https://www.npmjs.com/package/grunt-patch-wordpress.

#3 @sabernhardt
4 years ago

I tried this in WordPress 5.7 (with Windows and Firefox), and it seems to work now. Clicking the Close button within the (grid mode) dialog ended the audio playback, and so did the escape key.

If $('.wp-media-wrapper').remove(); is still necessary for another situation, line 4399 was the wp.media.view.UploaderWindow, which is in \src\js\media\views\uploader\window.js now.

https://live.staticflickr.com/65535/51087980011_20cf385402_c.jpg

Last edited 4 years ago by sabernhardt (previous) (diff)
Note: See TracTickets for help on using tickets.