Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Youtube video does not work under IE11. #453

Open
kristofferwiklund opened this issue Jul 1, 2015 · 1 comment
Open

Youtube video does not work under IE11. #453

kristofferwiklund opened this issue Jul 1, 2015 · 1 comment

Comments

@kristofferwiklund
Copy link

I have a very simple page.

<html>
  <head>
    <script src="/popcorn-js/dist/popcorn-complete.js"></script>
    <style>
      #video {
        width: 400px;
        height: 300px;
      }
    </style>
  </head>
  <body>
    <h1>Video</h1>
    <div id="video"></div>
    <script>
      var wrapper = Popcorn.HTMLYouTubeVideoElement("#video");
      wrapper.src = "https://www.youtube.com/watch?v=F7HcoKv11i0";
      var pop = Popcorn(wrapper);
      pop.play();
    </script>
  </body>
</html>

I have tried several prebuild version and also build one from source. The above code works nice in Chrome and Firefox on Windows. But with Internet Explorer 11 the video is loaded but nothing of popcornjs is run. The autoplay nor plugins are run.

On Mac and Safari the video is autoplaying as it should

I have also tried loading the video with:

  document.addEventListener("DOMContentLoaded", function () {
    var pop = Popcorn.youtube(
      '#video',
      'https://www.youtube.com/watch?v=F7HcoKv11i0' );
    pop.play();
  }, false);

As documented here http://popcornjs.org/popcorn-with-youtube. (Btw the demo is not working because of old version of popcornjs)

@TwoD
Copy link
Contributor

TwoD commented Jul 8, 2015

I have looked into this briefly and it appears that the YouTube plugin is getting stuck in onFirstPause, waiting for getCurrentTime() to return 0, which it never does.

There is a player.seekTo(0) in onFirstPlayed() just before the player is paused. The paused event does fire, but the current time is stuck at just a few 1/100s when it does.
Simply changing the getCurrentTime() comparison to make it > 0.2s or so will make it work reliably (autoplay, cues, seeking etc).

Stranglely enough, the problem only appears to happen when the files are fetched from the browser cache. Refreshing from the server with Ctrl+F5 made it autoplay without the change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants