Infinite Scroll with JWPlayer - Callback

I am using Infinite scroll and am already using callback for Magnific Popup.

The code for JWPlayer is in HTML, which looks like it also needs a callback to work outside of page 1, but I'm not sure how to do this, since it is only in 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,
    }
   });
  });
 }

});

HTML with JWPlayer:

    <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>
+4
source share
1 answer

Alternatively, you can use this sample to integrate scroll and player

http://playerjs.io/scroll.html

also for infinite scroll combining + jwplayer

fooobar.com/questions/1686907 / ...

0
source

Source: https://habr.com/ru/post/1686906/


All Articles