Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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
You can’t perform that action at this time.