Skip to content

Instantly share code, notes, and snippets.

@martin0258
Created February 9, 2016 13:54
Show Gist options
  • Save martin0258/5f016371325d4945a8c5 to your computer and use it in GitHub Desktop.
Save martin0258/5f016371325d4945a8c5 to your computer and use it in GitHub Desktop.
Play a YouTube video on website
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction(){
var iframe = document.getElementById('youtube');
iframe.src = iframe.src;
}
</script>
</head>
<body>
<iframe id="youtube" width="420" height="345"
src="http://www.youtube.com/embed/5yB3n9fu-rM?start=140&end=150&autoplay=1&rel=0&controls=0" frameborder="0">
</iframe>
<button onclick="myFunction()">Reload</button>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment