title: why is my oncanplaythrough function not triggering?
body: <p>i need a function to occur if the video is ready, but i want a 6sec delay before checking. when i put the vid.oncanplaythrough outside of showpage(); it works. i need it to work inside the function.</p>
  <pre><code> &lt;script&gt;
              var vid = document.getElementById(&quot;myVid&quot;);
              
              function splasher() {
                  showDelay = setTimeout(showPage, 6000);
                  alert(&quot;splasher&quot;);
              };
              
              function showPage() {
                  alert(&quot;showPage&quot;);
                  document.getElementById(&quot;splash&quot;).style.display = &quot;none&quot;;
                  document.getElementById(&quot;wrapper&quot;).style.display = &quot;block&quot;;
                  carousel();
                  showDivs(slideIndex = 1);
                  
                  vid.oncanplaythrough = function() {
                      alert(&quot;Can play through video without stopping&quot;);                   
                  };
              };
              splasher();
  &lt;/script&gt;
  </code></pre>