ios - Popcorn JS - 在 iPad 或 iOS 设备上通过 Youtube 使用爆米花

标签 ios ipad safari youtube popcornjs

我正在使用 popcornjs 加载与 YouTube 视频的交互。 当我使用文档中的代码时:

<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>    

它在任何浏览器上看起来都很完美,但在 iPad 上什么也没有显示。 当我加载带有爆米花但不使用 YouTube 的视频时,它似乎工作正常。

我能做什么?

最佳答案

不幸的是,ipad 不支持 Flash。我们确实正在与 Popcorn 合作,要求切换到他们的 HTML5 API,您可以在此处查看:

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

希望有帮助, 布雷特

关于ios - Popcorn JS - 在 iPad 或 iOS 设备上通过 Youtube 使用爆米花,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10588070/

相关文章:

objective-c - 动态添加新的表格 View 单元格

html - 让 OSX Safari 支持 css "white-space: pre"

ios - React Native 上的滚动位移与 Expo

ios - Objective-C 何时调用 cellForRowAtIndexPath?

iphone - 检查照片库的授权状态

javascript - Safari 第 3 方 cookie iframe 技巧不再有效?

jquery - 设置隐藏的下拉选择值会导致页面在 iOS 11 safari 中重新加载

ios - 取消选择时如何阻止 UITableViewCell 闪烁为白色?

ios - Xcode 横向多个 Storyboard

iphone - 从 UITableViewCell 到模态视图 Controller 的动画