Play and stop Vimeo video placed in Bootstrap modal
I have a Vimeo iframe video in Bootstrap video. I need to have it start playing when I trigger modal and stop playing when a modal is closed. Currently I can have in start playing on modal open by having iframe with no src attribute and having it filled with jQuery on triggering modal. This is the code snippet; jQuery("#videogumb").click(function() { jQuery('#myModal .modal-body iframe').attr('src','the-source-code'); }); This works fine and I get it to start when modal opens but when I close modal the music keeps playing in the background. The other method works fine when but only for closing