Skip to content

Instantly share code, notes, and snippets.

@manegame
Created February 17, 2017 14:40
Show Gist options
  • Save manegame/b7ea57716300d7be214db02153c25e9d to your computer and use it in GitHub Desktop.
Save manegame/b7ea57716300d7be214db02153c25e9d to your computer and use it in GitHub Desktop.
fullscreen function
var $ = document.querySelector.bind(document);
// Once the user clicks a custom fullscreen button
$(playButtonClass).addEventListener('click', function(){
// Play video and go fullscreen
player.playVideo();
var playerElement = $(playerWrapperClass);
var requestFullScreen = playerElement.requestFullScreen || playerElement.mozRequestFullScreen || playerElement.webkitRequestFullScreen;
if (requestFullScreen) {
requestFullScreen.bind(playerElement)();
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment