I\'ve got some YouTube embedding code (I will paste only code which is causing the trouble for me and cut things which are not public):
console.log(ytplayer);
yt
I was having a very similar issue and was struggling with an answer. My calls to playVideo() didn't seem to work.
ORIGINAL:
$('#play_movie').click(function(){
$('#video').show();
if(player)
{
if(typeof player.playVideo == 'function')
{
player.playVideo();
}
}
The issue was that the player was not yet available - if I just gave it a bit of time to show up, then the call worked
$('#play_movie').click(function(){
$('#video').show();
if(player)
{
var fn = function(){ player.playVideo(); }
setTimeout(fn, 1000);
}
Don't know if this is your exact issue, but I hope it helps someone