(, ), , youtube.
youtube
youtube: {
index: 'youtube.com/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index).
id: 'v=',
src: '//www.youtube.com/embed/%id%?autoplay=1'
}
, - , v =, autoplay = 1 .
, iframe youtube, :
iframe: {
patterns: {
youtube: {
src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0&feature=player_detailpage'
}
}
}
, id , rel feature ( )
, URL- html- v = , URL- .
:
$('.gallery-list').magnificPopup({
delegate: 'a',
type: 'image',
gallery: {
enabled: true
},
iframe: {
patterns: {
youtube: {
src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0'
}
}
}
});
:
<div class="gallery-list">
<a class="popup-youtube mfp-iframe" href="https://www.youtube.com/watch?v=83UHRghhars">Click here</a>
<img class="mfp-image" href="http://domain/image.jpg" width="100" height="200" />
</div>
mfp-iframe magnific iframe.
magnific , mfp-iframe css .
, - , magnific popup v =, , , autoplay rel url.