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 came across this post looking for something similar. I found my answer here, by relic180:
YouTube API - Firefox/IE return error "X is not a function" for any 'player.' request
Basically, Chrome can initialize youtube embeds even when the divs are hidden (i.e. display:none
), but FF and IE can't. My solution was a variant of relic180's:
I move my player to left:200%
or whatever when I want it invisible but getting initialized (and available for other calls to player
), then move it back on screen when I need it.