Make WordPress Core

Changeset 50256


Ignore:
Timestamp:
02/08/2021 09:42:43 PM (4 years ago)
Author:
antpb
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/media/views/modal.js

    r50001 r50256  
    133133        }
    134134
     135        // Pause current audio/video even after closing the modal
     136        $( '.mejs-pause button' ).click();
     137
    135138        // Enable page scrolling.
    136139        $( 'body' ).removeClass( 'modal-open' );
Note: See TracChangeset for help on using the changeset viewer.