爆米花不能与youtube视频一起使用

时间:2014-07-07 13:51:07

标签: javascript youtube-api popcornjs

当我在浏览器(Chrome,Firefox)中测试时,它不会弹出。我不知道我做错了什么但它对我不起作用。

<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',
       'https://www.youtube.com/watch?v=2-XgMuIfIdA' );

     // 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();

  }, false);
</script>

0 个答案:

没有答案