Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Goran has posted the api reference. I would recommend checking that out. Here is some basic code for what you're looking for though. I've commented the main parts:</p> <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"&gt;&lt;/script&gt; &lt;script&gt; //this function gets called when the player is ready function onYouTubePlayerReady (playerId) { ytplayer = document.getElementById("myytplayer"); console.log(ytplayer); } //generic seekTo function taking a player element and seconds as parameters function playerSeekTo(player, seconds) { player.seekTo(seconds); } &lt;/script&gt; &lt;div id="ytapiplayer"&gt; You need Flash player 8+ and JavaScript enabled to view this video. &lt;/div&gt; &lt;br/&gt; &lt;a href="#" onclick="playerSeekTo(ytplayer, 70); return false;"&gt;Link to 1 minutes 10 seconds&lt;/a&gt; &lt;a href="#" onclick="playerSeekTo(ytplayer, 90); return false;"&gt;Link to 1 minutes 30seconds&lt;/a&gt; &lt;a href="#" onclick="playerSeekTo(ytplayer, 110); return false;"&gt;Link to 1 minutes 50 seconds&lt;/a&gt; </code></pre> <p>Now the js:</p> <pre><code>var ytplayer; $(document).ready(function() { swfobject.embedSWF("//www.youtube.com/e/Py_IndUbcxc?enablejsapi=1&amp;playerapiid=ytplayer &amp;version=3", "ytapiplayer", // where the embedded player ends up "425", // width "356", // height "8", // swf version null, null, { allowScriptAccess: "always" }, { id: "myytplayer" // here is where the id of the element is set }); }); </code></pre> <p><a href="http://jsfiddle.net/YMsz8/2/">Here</a> is the fiddle that I created.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload