I have embedded a video with magnificpopup script. I am unable to remove related videos at the end of the reproduction of a youtbe embedded.
Here is the code I have tried:
<a class="popup-youtube" href="https://www.youtube.com/watch?rel=0&feature=player_detailpage&v=83UHRghhars">
but does not work. The following code nor reproduce the video
<a class="popup-youtube" href="https://www.youtube.com/watch?feature=player_detailpage&v=83UHRghhars&rel=0">
if i put the embed code that youtube tell me:
//www.youtube.com/embed/83UHRghhars?rel=0
the video does not work. What I am doing wrong?
I found in the docu of the Magnific Popup the callback
markupParse
:It seems to be the best option to adjust an already existing script. The listen have alternative names which comes realy handy:
I used
mfpMarkupParse
to adjust my URL eg.:Or you use the jQuery extend function and update the
defaults
ofmagnificPopup
:Keep in mind that the attribute
rel=0
changed its behavior since 2018 (source).