Hi.
I try insert embed YT video link like "http://www.youtube.com/embed/uz8NDWopZyU" with iframe
$.magnificPopup.open({
items: {
src: video,
type:'iframe'
},
})
But YT return error.
In the html of iframe tag I'll see next link:
<iframe class="mfp-iframe" src="//www.youtube.com/embed/http://www.youtube.com/embed/uz8NDWopZyU?autoplay=1" frameborder="0" allowfullscreen=""></iframe>
In advance I don't know what the link is.
@snnwolf: Don't use embedded link (http://www.youtube.com/embed/uz8NDWopZyU), use direct link instead (https://www.youtube.com/watch?v=uz8NDWopZyU).
We have a website where the content editors have varying degrees of tech savvy-ness (so to speak). Most hit share to get the url or get the embed link, not using the embed link isn't a solution.
I saw a question about this and it was suggested that you could define your own link types, can you point me in the right direction please? I need to create a solution that supports all possible youtube link types (not the one they're least likely to use when inserting videos into the website).
Thanks
Ho about link to channel? (http://www.youtube.com/channel/UCYHWmCD-V7iNAKdU6yX4mOg/live)
Late to the party, in case someone needs to use the actual embed URL for Magnific, here is my process:
// Video popup, Backend enforces embed URL before it gets here.
$('.js-popup-video').magnificPopup({
type: 'iframe',
iframe: {
patterns: {
youtube: {
index: 'youtube.com/',
id: function (url) { return url },
src: '%id%'
},
vimeo: {
index: 'vimeo.com/',
id: function (url) { return url },
src: '%id%'
}
}
}
});
@WJakub thanks for the info! You're process fixed my problem
@WJakub It's been a while but thanks, I'll be sure to give this a go if we encounter this problem again
@WJakub Thanks Bro...Its working perfectly
This solution will work best for all YouTube link patterns.
https://stackoverflow.com/a/48696208
Most helpful comment
Late to the party, in case someone needs to use the actual embed URL for Magnific, here is my process: