-4

How can I stop video when modal is closed? breeze.customertests.com/#video-modal

The problem I'm having with this is when I play the video and exit the screen while it is being played, the video continues to play in the background. If I click on the Watch Video link again, it would play the video from where it stopped off previously.

I need to have the video stop when the modal window is closed. I'm still new to this and am not sure how to do this. Anyone know how I can achieve this?

1 Answers1

1

You can use Javascript to accomplish this.

$(function(){
    $('#myModal').modal({
        show: false
    }).on('hidden.bs.modal', function(){
        $(this).find('video')[0].pause();
        $(this).find('video')[0].currentTime = 0;
    });
});