Last active
December 3, 2016 03:08
-
-
Save nirvanatikku/2a9ec20ceb20adead1431de30dccb31c to your computer and use it in GitHub Desktop.
Simple YouTube Player Management, using the jQuery TubePlayer Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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