youtube1.html 1.56 KB
Newer Older
Andrew Rozsa's avatar
Andrew Rozsa committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
<!doctype html>
<html style="width: 100%; height: 100%;">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="user-scalable=no">
    <script src="https://www.youtube.com/player_api"></script>
  <style>
    .player {
    pointer-events: none;
    position: absolute;
            }
  </style>
  <script>
 /*   var elem = document.getElementsByTag("body");
    function openFullscreen() {
      if (elem.requestFullscreen) {
        elem.requestFullscreen();
      } else if (elem.webkitRequestFullscreen) { // Safari 
        elem.webkitRequestFullscreen();
      } else if (elem.msRequestFullscreen) { // IE11 
        elem.msRequestFullscreen();
      }
    }
    window.addEventListener("resize", openFullscreen);
*/
    </script>
</head>
 
  <body style="width: 95vw; height: 95vh; position: relative;">
    <iframe class="player" id="player" style="width: 60%; height: 60%; display: block; position: absolute; top: 60%; left: 60%; transform: translate(-50%, -50%);" src="https://youtube.com/embed/UZ3oEn5Q7U4?&amp;cc_load_policy=3&amp;autoplay=1&amp;start=0&amp;fs=0&amp;controls=0&amp;modestbranding=1&amp;disablekb=1&amp;loop=1"></iframe>
    <script type="text/javascript">
      var player;
      function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
          videoId: 'kpCJyQ2usJ4',
          events: {
            'onStateChange': function(e){
              if(e.data == 0){
                parent.$(window.top).data('continueRoutine', false);
              }
            }
          }
        });
      }
    </script>
  </body>
</html>