【问题标题】:Infinite scroll with JWPlayer - callback使用 JWPlayer 无限滚动 - 回调
【发布时间】:2017-10-04 16:54:01
【问题描述】:

我正在使用无限滚动并且已经在使用 Magnific Popup 的回调。

JWPlayer 的代码在 HTML 中,看起来它还需要回调才能在第 1 页之后工作,但我不确定如何处理,因为它只在 HTML 中。

$grid.infiniteScroll({
  path: '.pagination__next',
  append: '.grid__item',
  outlayer: msnry,
  status: '.page-load-status',
  onInit: function() {
  this.on( 'append', function() {
   $('.open-pop').magnificPopup({
   type: 'inline',
   mainClass: 'mfp-fade',
   fixedContentPos: false,
   gallery: {
     enabled: true, 
     navigateByImgClick: false,
    }
   });
  });
 }

});

带有 JWPlayer 的 HTML:

    <script type="text/javaScript">
    var playerInstance = jwplayer("myElement-{{ entry.mediaId }}");
    playerInstance.setup({
    file: "//content.jwplatform.com/videos/{{ entry.mediaId }}.mp3",
    image:"http://content.jwplatform.com/thumbs/{{ entry.mediaId}}.jpg",
    stretching:"fill",
    mediaid: "{{ entry.mediaId }}"
    });
    </script>

【问题讨论】:

  • 您是否尝试过将脚本移动到单独的文件并将其包含到您需要的所有页面中?

标签: jquery callback jwplayer infinite-scroll


【解决方案1】:

您也可以将此示例用于滚动和播放器集成

http://playerjs.io/scroll.html

也适用于无限滚动+ jwplayer 集成

https://stackoverflow.com/a/10627683/1302691

【讨论】:

    猜你喜欢
    • 2012-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多