I'm finding it difficult to load a YouTube video using magnificpopup.
I could not find any solution on the following reference: how to load magnific popup on page load.
Here's the code:
$(document).ready(function(){
$.magnificPopup.open({
disableOn: 700,
type: 'iframe',
removalDelay: 160,
preloader: true,
fixedContentPos: false,
iframe: {
patterns: {
youtube: {
index: 'https://youtube.com/',
id: 'v=somevideo',
src: 'http://www.youtube.com/embed/%id%?autoplay=1'
}
}
}
});
});
I need the video to load on page load. It throws an error stating:
Uncaught TypeError: Cannot read property 'parsed' of undefined