Media: Pause any playing media when closing the the media modal.

Previously, any video or audio playing in the media modal failed to stop playing when the modal was closed. Now we pause the player when the modal is closed.

Props adamsilverstein, hellofromTonya, paaljoachim, Mista-Flo, Clorith, justinahinon, afercia, amolv.
Fixes #48562.

Built from https://develop.svn.wordpress.org/trunk@50256


git-svn-id: http://core.svn.wordpress.org/trunk@49901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
antpb 2021-02-08 21:44:09 +00:00
parent 219d92f75b
commit b981f48184
3 changed files with 5 additions and 2 deletions

View File

@ -4532,6 +4532,9 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
return this;
}
// Pause current audio/video even after closing the modal
$( '.mejs-pause button' ).click();
// Enable page scrolling.
$( 'body' ).removeClass( 'modal-open' );

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-beta1-50255';
$wp_version = '5.7-beta1-50256';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.