title: Turn off All HTML5 Video
body: <p>I'm looking for a method to turn off all HTML5 video on a site with a single video. I'm developing an app that uses modal windows to show content. Some of this content is HTML5 video. When a user plays a video and then decides to close the modal window containing that video, I would like the video to stop. </p>
  
  <p>I've tried a method like the following:</p>
  
  <pre><code>function stopVideo() {
      // Make sure to turn off and reset the video
      $( '.html5-video' ).each( function( index, element ) {
          $( this ).get( 0 ).currentTime = 0;
          $( this ).get( 0 ).pause();
      } );
  }
  </code></pre>
  
  <p>This works fine in Safari; however, in FireFox and Chrome, it throws an error suggesting that because the element is hidden, it is no longer useable. Does anyone have an idea of how to reliably stop all video?</p>
  
  <p>Thanks!</p>