title: Play and stop Vimeo video placed in Bootstrap modal
body: <p>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;</p>
  
  <pre><code>    jQuery("#videogumb").click(function() {
      jQuery('#myModal .modal-body iframe').attr('src','the-source-code');
      });
  </code></pre>
  
  <p>This works fine and I get it to start when modal opens but when I close modal the music keeps playing in the background. </p>
  
  <p>The other method works fine when but only for closing the modal without having it set to autoplay. So the autoplay is set to 0 and I have this snippet;</p>
  
  <pre><code>    jQuery(".modal-backdrop, #myModal .close, #myModal .btn").live("click", function() {
      jQuery("#myModal iframe").attr("src", jQuery("#myModal iframe").attr("src"));
      });
  </code></pre>
  
  <p>This stops the video when I close modal. 
  I need to have this combined somehow. I need to have it autoplay when modal opens and to stop playing when modal closes. </p>
  
  <p>Any clues?</p>
  
  <p>Thanks.</p>