Here is my DEMO.
I want to autoplay youtube video once clicked on "Play Youtube Video". Here is my code which isn't working for me.
jQuery('.playButton').click(function(){
jQuery("iframe").each(function() {
jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
});
});
This code works when iframe is outside of lightbox. And I understand that behaviour but I need to autoplay within lightbox.