Infinite scroll with JWPlayer - callback

Viewed 213

I'm using Infinite scroll and already using a callback for Magnific Popup.

The code for JWPlayer is in the HTML which looks like it also needs a callback to work beyond page 1, but I'm not sure how to go about this as it's solely in the 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>
1 Answers
Related