Reputation: 1578
I have a video inside a modal, which can be opened through many links across the page.
The problem is, when I close the modal with the video running, I can still hear the video... which makes sense, but I don't want it.
Is there a way to implement a hook in Bootstrap's events, like modal? Some event or other thing that allow me to stop the video when the modal is closed.
Upvotes: 1
Views: 1587
Reputation: 7295
Handle either hide
or hidden
event* which modal is triggering before and after close respectively.
$('#myModal').on('hidden', function () {
// stop the video playback
});
*Here are all supported events and methods.
Upvotes: 2