Skip to content

Instantly share code, notes, and snippets.

@nirvanatikku
Last active December 3, 2016 03:08
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 nirvanatikku/2a9ec20ceb20adead1431de30dccb31c to your computer and use it in GitHub Desktop.
Save nirvanatikku/2a9ec20ceb20adead1431de30dccb31c to your computer and use it in GitHub Desktop.
Simple YouTube Player Management, using the jQuery TubePlayer Plugin
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="dist/jquery.tubeplayer.min.js"></script>
</head>
<body>
<div id="youtube-player"></div>
<script type="text/javascript">
jQuery(document).ready(function(){
window.$player = jQuery("#youtube-player").tubeplayer({
width: 1280,
height: 720,
initialVideo: "DkoeNLuMbcI",
onPlayerLoaded: function(){
this.tubeplayer("volume", 25);
this.tubeplayer("seek", "1:33"); // Jump to T.I.
},
onPlayerEnded: function(){
alert("that was awesome!");
}
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment