javascript - Positioning an embedded YouTube player -


I am creating an interactive video site and this is the function:

  var tag = Document .createElement (such as script '); Tag src = "https://www.youtube.com/iframe_api"; Var firstScriptTag = document.getElementsByTagName ('script') [0]; FirstScriptTag.parentNode.insertBefore (tag, firstScriptTag); Var done = false; Var player; Change function video (BTNID) {player = new YT.Player ('player', {height: '390', width: '640', player wars: {'autoplay': 0, 'control': 0, 'autohoid' : 2, 'disabled cab': 1, 'Modestbranding': 1, 'FS': 0}, Video: BTNID, Event: {'Onestate Change': OnplatformState Change}}); }  

But I can not find any way to change the position of the video player (it is loading on top left of browser) Is there a way to target CSS to the player who was called to use the function?

It seems that you might miss the division for your player, that is, & Lt ;! - 1. & lt; Iframe & gt; (And video player) this & lt; Div & gt; Tag - & gt; & Lt; Div id = "player" & gt; & Lt; / Div & gt; Take a look at

Your player will replace this div, as it says. Therefore, place the divisions where you want the player.

Hope it helps.


Comments

Popular posts from this blog

eclipse plugin - Run java code error: Workspace is closed -

ios - How do I use CFArrayRef in Swift? -

scala - Play Framework - how to bind form to a session field -