Reputation: 11
I am dynamically adding an <iframe> and adding a YouTube video. The YouTube player working fine but the full screen controls are not showing.
The code is:
var newIframe = $("<iframe width='80px' height='80px' "
+ "src='http://www.youtube.com/watch?v=r3TtgYuaVFk' "
+ "frameborder='0' allowfullscreen id='vid" + mindBoxID + "'>");
var tmp = "#"+mindBoxID;
$(tmp).append(newIframe);
Upvotes: 1
Views: 1213
Reputation: 3284
You src
URL is wrong, use src='http://www.youtube.com/embed/r3TtgYuaVFk'
instead.
var newIframe = $("<iframe width='80px' height='80px' "
+ "src='http://www.youtube.com/embed/r3TtgYuaVFk' "
+ "frameborder='0' allowfullscreen id='vid" + mindBoxID + "'>");
var tmp = "#"+mindBoxID;
$(tmp).append(newIframe);
The documentation on <iframe> embedded videos is available here https://developers.google.com/youtube/player_parameters#Manual_IFrame_Embeds
Upvotes: 2