iosipadsafariyoutubepopcornjs

Popcorn JS - Use of popcorn with Youtube on an iPad or iOS device


I am using popcornjs to load an interact with a video from youtube. When I use the code from the documentation:

<html>
  <head>
<script src="http://popcornjs.org/code/dist/popcorn-complete.min.js"></script>

<script>
  // ensure the web page (DOM) has loaded
  document.addEventListener("DOMContentLoaded", function () {

       // Create a popcorn instance by calling the Youtube player plugin
     var example = Popcorn.youtube(
       '#video',
       'http://www.youtube.com/watch?v=CxvgCLgwdNk' );

     // add a footnote at 2 seconds, and remove it at 6 seconds
     example.footnote({
       start: 2,
       end: 6,
       text: "Pop!",
       target: "footnotediv"
     });

     // play the video right away
     //example.play(); => commented because you can't autoplay on ios

  }, false);
</script>
  </head>
  <body>
    <div id="video" style="width: 360px; height: 300px;" ></div>
    <div id="footnotediv"></div>
  </body>
</html>    

It looks perfect on any browser, but nothing shows on the iPad. When I load a video with popcorn but without using Youtube, it seems to work fine.

What can I do?


Solution

  • Unfortunately, the ipad doesn't support Flash. We do have a ticket in progress with Popcorn to switch to their HTML5 API, which you can view here:

    https://webmademovies.lighthouseapp.com/projects/63272/tickets/329-support-youtube-html5-api-playback-engine

    Hope that helps, Brett