Skip to content

Instantly share code, notes, and snippets.

@calzoneman
Created April 17, 2014 16:12
Show Gist options
  • Save calzoneman/10995097 to your computer and use it in GitHub Desktop.
Save calzoneman/10995097 to your computer and use it in GitHub Desktop.
YouTube autohide controls bug
<!doctype html>
<html lang="en">
<head>
<title>YouTube controls autohide bug</title>
<meta charset="utf-8">
</head>
<body>
<div id="ytapiplayer"></div>
<script src="https://www.youtube.com/iframe_api"></script>
<script src="player.js"></script>
</body>
</html>
var PLAYER;
function onYouTubeIframeAPIReady() {
PLAYER = new YT.Player("ytapiplayer", {
width: '640',
height: '400',
videoId: 'Wevh2d7nTUY',
playerVars: {
autohide: 1,
},
events: {
onReady: function () {
beginTest();
}
}
});
}
function beginTest() {
PLAYER.playVideo();
PLAYER.pauseVideo();
setTimeout(function () {
PLAYER.playVideo();
}, 3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment