Created
November 22, 2014 15:03
-
-
Save user19/3f46f54cb3c8b30a9d98 to your computer and use it in GitHub Desktop.
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
| window.document.getElementsByTagName("html")[0].innerHTML = "<html><head><style type=\"text/css\"></style></head><body><input type=\"button\" value=\"実行\" onclick=\"func();\"/><div id=\"player\"></div></body></html>"; | |
| var elements = {}; | |
| var player = window.document.getElementById("player"); | |
| var style = window.document.getElementsByTagName("style")[0]; | |
| var exp = Number(window.prompt( "level", "2")); | |
| var v = window.prompt( "動画のID", "PqJNc9KVIZE")+"?autoplay=1&controls=0&showinfo=0"; | |
| function func(){ | |
| style.innerHTML = "#player{width:"+window.parent.screen.width+"px;height:"+Math.floor(window.parent.screen.width*9/16)+"px;} iframe{vertical-align:bottom;width:"+100/exp+"%;height:"+100/exp+"%;}"; | |
| var baseNode = window.document.createElement("iframe"); | |
| baseNode.src = "//www.youtube.com/embed/"+v; | |
| baseNode.setAttribute("frameborder","0"); | |
| for(var i=1; i<=Math.pow(exp,2); i++)elements[i] = baseNode.cloneNode(true); | |
| 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; | |
| for(key in elements)player.appendChild(elements[key]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment