<html>
 <head>
  <meta name="viewport" content="width=device-width">
  <meta name="robots" content="noindex">
  <style>
            body {
                padding: 0;
                margin: 0;
                /*position: relative;*/
            }
        </style>
  <script type="text/javascript">
          // document.domain = 'ck12.org';

          var mode = '';
          window.onload = init;

          function isYouTube(src){
              return (src.indexOf('youtube.com/') !== -1) || (src.indexOf('youtu.be/') !== -1)
          }

          function addIframeMessageListener()
          {
            window.addEventListener('message', function(e) {
            var eventName = e.data[0];
            var data = e.data[1];
            switch(eventName) {
          /* the child iframe can set its height using:
              window.parent.postMessage(["setHeight", height], "*");  */
            case 'setHeight':
              document.getElementById("assessmentFrame").style.height = data + "px"
                    frameElement.style.height = data + "px"
                    frameElement.parentElement.style.height = data + "px"
                    break;
              }
            }, false);
          }

          function init() {
            var embedCode = document.getElementById('embed').value;
            var tmp = document.createElement('div');
            tmp.innerHTML = embedCode;
            var secure = 'https:' === document.location.protocol;
            var iframes = tmp.querySelectorAll('iframe');
            if (iframes.length == 0) {
              document.body.appendChild(tmp);
              return;
            }
            for (var i = 0; i < iframes.length; i++) {
              var frame = iframes[i];
              var framesrc = frame.src;
              if (secure && framesrc.indexOf('http://') !== -1) {
                framesrc = framesrc.replace('http:', 'https:');
              }
              if (mode === 'autoplay'){
                if (isYouTube(framesrc)){
                  framesrc = framesrc + ( (framesrc.indexOf('?') !== -1)?'&':'?' ) + 'autoplay=1';
                }
              }
              frame.src = framesrc;
              document.body.appendChild(tmp);
            }
            addIframeMessageListener();
            resizeSimAndPlixIframes();
          }

          // For sim and PLIX iframes using old embed code, increase the frame height
          function resizeSimAndPlixIframes() {
             try {
                 var iframes = window.parent.document.getElementsByTagName("iframe");
                 for (var i = 0; i < iframes.length; i++) {
                     // console.log("src: " + iframes[i].src);
                     if (iframes[i].src.indexOf(encodeURIComponent('module=launcher')) !== -1) {
                         iframes[i].height = '335px';
                         iframes[i].setAttribute('allowfullscreen', 'allowfullscreen');
                     }
                 }
             } catch (e) {}
          }
        </script>
 </head>
 <body>
  <textarea id="embed" disabled style="display:none">
        &lt;iframe frameborder="0" width="95%" height="95%" allowfullscreen="true" frameborder="0" style="border:none" src="/media/video.mp4"&gt;
&lt;p&gt;
 Your browser does not support iframes.
&lt;/p&gt;
&lt;/iframe&gt;
        </textarea>
 </body>
</html>