Skip to content

Instantly share code, notes, and snippets.

@kixorz
Created April 4, 2014 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kixorz/9978508 to your computer and use it in GitHub Desktop.
Save kixorz/9978508 to your computer and use it in GitHub Desktop.
YouTube API experiment
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div>
<script type="text/javascript">
/*
https://developers.google.com/youtube/js_api_reference#EventHandlers
*/
function onYouTubePlayerReady( playerId ) {
console.log( "youtube loaded", playerId );
};
var videoId = "";
var params = { allowScriptAccess: "always" };
var atts = { id: "bossplayer" };
swfobject.embedSWF( "http://www.youtube.com/v/" + videoId + "?enablejsapi=1&playerapiid=bossplayer&version=3", "ytapiplayer", "425", "356", "8", null, null, params, atts);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment