Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1136053

    Hi,
    I’m using this script to create a modal out of a div, and it works perfectly but when I close the modal while the video is still playing, the video doesn’t stop.
    What am I doing wrong?

    		function inline_popup_enabler() {
    	?>
    	<script>
    		(function($){ $(window).load(function() {
    				$('.inline_popup').magnificPopup({
    					items: {
    						src: $('#videooverlay'),
    					},
    					type:'inline',
    					midClick: true,
    					preloader: true,
    					modal: true
    				});
    			});
    		})(jQuery);
    	</script>
    	<?php
    	}
    	add_action('wp_footer', 'inline_popup_enabler');
    

    Thanks in advance!

    • This topic was modified 1 month, 1 week ago by  midfieldco.
    #1137057

    Hey midfieldco,

    Thank you for the inquiry.

    You should be able to pause the video when the lightbox closed.

    // https://www.w3schools.com/tags/av_met_pause.asp

    Add it inside the close callback.

    // https://dimsemenov.com/plugins/magnific-popup/documentation.html#api

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.