Skip to content

Instantly share code, notes, and snippets.

@user19
Created November 27, 2014 07:18
Show Gist options
  • Save user19/e578137a4299d56ab32c to your computer and use it in GitHub Desktop.
Save user19/e578137a4299d56ab32c to your computer and use it in GitHub Desktop.
var player = document.getElementById("player");
player.addEventListener("click", function(event){
style = window.document.createElement("style");
style.innerHTML = "iframe{width:"+window.parent.screen.width+"px;height:"+Math.floor(window.parent.screen.width*9/16)+"px;}";
window.document.getElementById("main").appendChild(style);
if (player.webkitRequestFullScreen)
player.webkitRequestFullScreen();
else if(player.mozRequestFullScreen)
player.mozRequestFullScreen();
else if(player.msRequestFullscreen)
player.msRequestFullscreen();
else if(player.requestFullScreen)
player.requestFullScreen();
else
return false;
},false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment