Stop video playing when Bootstrap modal is closed

If you want add a video to a Bootstrap Modal and either dismiss or close the modal while the video is playing the video will keep on playing when you open again. So you can adjust this behaviour by adding in some JavaScript that acts to stop the video if either the modal window is clicked to close or the background is clicked to dismiss the modal.
Add below JavaScript code in your files
jQuery('#keredariModal').on('', function (e) {
  // do something...
  jQuery('#keredariModal video').attr("src", jQuery("#keredariModal  video").attr("src"));
Note: Please replace your Model ID


Popular posts from this blog