<a href="#media-popup" data-media="http://www.youtube.com/embed/lgZBsWGaQY0?autoplay=1">asd</a></p>
<div class="popup" id="media-popup">
<iframe width="560" height="315" src="" frameborder="0" allowfullscreen></iframe>
</div>
$("[data-media]").on("click", function(e) {
e.preventDefault();
var $this = $(this);
var videoUrl = $this.attr("data-media");
var popup = $this.attr("href");
var $popupIframe = $(popup).find("iframe");
$popupIframe.attr("src", videoUrl);
$this.closest(".page").addClass("show-popup");
});
$(".popup").on("click", function(e) {
e.preventDefault();
e.stopPropagation();
$(".page").removeClass("show-popup");
});
$(".popup > iframe").on("click", function(e) {
e.stopPropagation();
});