I have a list of iframe videos in my webpage.
You can modify this code with an iteration
/** * Stop an iframe or HTML5 from playing * @param {Element} element The element that contains the video */ var stopVideo = function ( element ) { var iframe = element.querySelector( 'iframe'); var video = element.querySelector( 'video' ); if ( iframe ) { var iframeSrc = iframe.src; iframe.src = iframeSrc; } if ( video ) { video.pause(); } };
OWNER: https://gist.github.com/cferdinandi/9044694 also posted here (by me): how to destroy bootstrap modal window completely?