Skip to content

Instantly share code, notes, and snippets.

@jayesh15111988
Created October 30, 2015 00:43
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 jayesh15111988/20665f69fcf1e5b061a6 to your computer and use it in GitHub Desktop.
Save jayesh15111988/20665f69fcf1e5b061a6 to your computer and use it in GitHub Desktop.
<html>
<body style='margin:0px;padding:0px;'>
<script type='text/javascript' src='http://www.youtube.com/iframe_api'></script>
<script type='text/javascript'>
var ytplayer;
function timeElapsed() {
return Math.floor(ytplayer.getCurrentTime())
}
function onYouTubeIframeAPIReady() {
ytplayer = new YT.Player('playerId', {
events: {
onReady: onPlayerReady
}
})
}
function onPlayerReady(a) {
a.target.playVideo();
}
</script>
<center>
<br/>
<br/>
<iframe id='playerId' type='text/html' width='320' height='200' src='http://www.youtube.com/embed/youtube_video_id?enablejsapi=1&rel=0&playsinline=1&autoplay=0' frameborder='0'>
</center>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment