Answers for "stop iframe video on modal close using javascript"

CSS
0

how to stop iframe video using javascript

var stopVideo = function ( element ) {
    var iframe = element.querySelector( 'iframe');
    var video = element.querySelector( 'video' );
    if ( iframe !== null ) {
        var iframeSrc = iframe.src;
        iframe.src = iframeSrc;
    }
    if ( video !== null ) {
        video.pause();
    }
};
Posted by: Guest on September-03-2021
0

closing modal on iframe movies still running

$("#myModal").on('hidden.bs.modal', function (e) {
    $("#myModal iframe").attr("src", $("#myModal iframe").attr("src"));
});
Posted by: Guest on January-04-2021

Code answers related to "stop iframe video on modal close using javascript"

Browse Popular Code Answers by Language