Skip to content Skip to sidebar Skip to footer

Video Keeps Playing After Modal Is Closed Firefox

I have an object that loads videos into the DOM via twitter bootstrap's modal when you click on an image, see fiddle. The video works fine in all browsers except in Firefox. So aft

Solution 1:

This solution seems to be working.

Add this JS after you have loaded the above script (just before the closing body tag)

<script type="text/javascript">
    $('#myModal').on('hidden.bs.modal', function () {
        var videos = $('#video');
        video.pause()
    });
</script>

Solution 2:

You can stop video using javascript:

 var video = document.getElementById("video");
 function stopVideo() {
     video.pause();
     video.currentTime = 0;
 }

and call stopVideo function on modal close event


Post a Comment for "Video Keeps Playing After Modal Is Closed Firefox"