Skip to content

Instantly share code, notes, and snippets.

@moladukes
Last active February 22, 2016 00:43
Show Gist options
  • Save moladukes/be913af35f0fe2add0ad to your computer and use it in GitHub Desktop.
Save moladukes/be913af35f0fe2add0ad to your computer and use it in GitHub Desktop.
Fullscreen Youtube Background
<script src="http://www.youtube.com/player_api"></script>
<div id="player"></div>
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {
playerVars: {
'autoplay': 1,
'controls': 0,
'autohide': 1,
'wmode': 'opaque',
'showinfo': 0,
'loop': 1,
'mute': 1,
//'start': 15,
//'end': 110,
'playlist': 'NQKC24th90U'
},
videoId: 'NQKC24th90U',
events: {
'onReady': onPlayerReady
}
});
}
function onPlayerReady(event) {
event.target.mute();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment