Hi,
I put a Modal popup in my page with a video content and I want the frame close automatically when the video ends.
How can I do that?
I tried to put the custom javascript below in template custom code section but it didn't work:
jQuery(document).on('mfpOpen', function () {
var video = jQuery('.mfp-content video').get(0);
if (video) {
video.addEventListener('ended', function () {
jQuery.magnificPopup.close();
});
}
});
Thanks a lot for your suggestions.