Created
February 17, 2017 14:40
-
-
Save manegame/b7ea57716300d7be214db02153c25e9d to your computer and use it in GitHub Desktop.
fullscreen function
This file contains 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 $ = 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