Dhina Legacy
Dhina Legacy

Reputation: 11

YouTube Full screen control not showing

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

Answers (1)

cfedermann
cfedermann

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

Related Questions