I'm working on a website, that would like to display a youtube video when someone opens the page (with a delay of 5 seconds) with magnific popup.
This is the code that works (thanks to @Yoink!)
setTimeout(function(){
$.magnificPopup.open({
items: {
src: 'http://www.youtube.com/watch?v=0O2aH4XLbto'
},
type: 'iframe'
});
}, 5000)