Created
November 2, 2012 23:07
-
-
Save robinsloan/4004892 to your computer and use it in GitHub Desktop.
YouTube API scraps
This file contains hidden or 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
var tag = document.createElement('script'); | |
tag.src = "http://www.youtube.com/player_api"; | |
var firstScriptTag = document.getElementsByTagName('script')[0]; | |
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); | |
var gYTPlayer; | |
var onYouTubePlayerAPIReady = function() { | |
gYTPlayer = new YT.Player('gYTPlayer', { | |
width: 640, | |
height: 386, | |
videoId: '7_a7OTE2nLg', | |
events: {'onReady': onPlayerReady}, | |
playerVars:{wmode:'transparent', | |
showinfo:0, | |
autoplay:0, | |
modestbranding:1, | |
rel:0, | |
loop:1, | |
controls:1} | |
}); | |
} | |
var onPlayerReady = function(event) { | |
gYTPlayer.mute(); | |
} | |
var gStartVideo = function(){ | |
gYTPlayer.mute(); | |
gYTPlayer.seekTo(80); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment