I'm currently working on Bootstrap to put the video in modal. Everything is created using cms (so I can not control how much video will be shown.)
Everything is going well (I have to give each modal its own identifier, and everything works). The fact is that when you close the modal mode and the video works, the video (and sound) continue to work in the background.
To avoid this, when the modal is closed with the x button, I update the html in a modal format, for example:
$('button.close').click(function(){ var divcible=$(this).parent().parent().find(".modal-body"); var html = divcible.html() divcible.html("") divcible.html(html) })
My problem is that if the user clicks on the background, the HTML will not reset. on boostrap website they call it
$('#myModal').on('hidden', function () {
to track when one modal closes, but I want to find if there is a way to control when ANY modal closes.
source share