Title: Infinite scroll (Callback)
Last modified: August 30, 2016

---

# Infinite scroll (Callback)

 *  Resolved [vuewer](https://wordpress.org/support/users/vuewer/)
 * (@vuewer)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/)
 * Hi There,
 * Im using an infinite scroll plugin (www.betapix.nl). If you scroll down, after
   an pagination, video preview and controls aren’t displaying correctly. Which 
   callback can i use so that it is displaying properly again?
 * Thanks so much in advance! Such a great plugin!
 * PS: It would be great if GIF could be compatible for encoding to MP4, WEBM(VP9)
   🙂 It should be possible..
 * Sander van Hooff
 * [https://wordpress.org/plugins/video-embed-thumbnail-generator/](https://wordpress.org/plugins/video-embed-thumbnail-generator/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/#post-6421100)
 * To avoid loading unnecessary scripts if users aren’t actually using the video
   player, the player is only loaded in the header/footer on page load. Since infinite
   scroll doesn’t load a new page, the scripts aren’t loaded. You’ll have to always
   load the video player scripts. I think this will work if you add it to your functions:
 *     ```
       function always_load_kgvid_shortcode_scripts() {
       kgvid_enqueue_shortcode_scripts();
       }
       add_action('wp_enqueue_scripts', 'always_load_kgvid_shortcode_scripts', 12);
       ```
   
 * This has not been tested, so use at your own risk.
 * I had never considered converting animated GIFs using FFMPEG. I’ll look into 
   it.
 *  Thread Starter [vuewer](https://wordpress.org/support/users/vuewer/)
 * (@vuewer)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/#post-6421123)
 * Hi Kyle,
 * Thanks for your quick reply! I’ve put the above code to my functions.php but 
   with no results.
 * The plugin that i am using ([http://codecanyon.net/item/animated-infinite-scroll-wordpress-plugin/9631163](http://codecanyon.net/item/animated-infinite-scroll-wordpress-plugin/9631163))
   supports jQuery callbacks>> [http://prntscr.com/83eg7c](http://prntscr.com/83eg7c)(
   see below on screenshot)
    Any suggestion for this? The two inputted callbacks
   above do work perfectly. Im be willing to pay you for this.
 * Thanks in advance!
 * Sander
 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/#post-6421233)
 * `kgvid_enqueue_shortcode_scripts()` is a PHP function, not a jQuery or JavaScript
   function, so adding that to your infinite scroll plugin just generates an error
   on the page.
 * The scripts are loading but not initializing the dynamically loaded videos. Try
   defining this JavaScript function on every page either inline or in a .js file.
 *     ```
       function kgvid_load_dynamic_video() {
            jQuery('.video-js').each( function(){
                 videojs(this, {}, function() { } );
                 kgvid_resize_video(jQuery(this).parents('.kgvid_videodiv').data('id'));
            });
       }
       ```
   
 * Then add `kgvid_load_dynamic_video();` to your infinite scroll plugin’s callback
   list.
 *  Thread Starter [vuewer](https://wordpress.org/support/users/vuewer/)
 * (@vuewer)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/#post-6421281)
 * Hi Kyle,
 * At first i thought it didn’t work, but after some research i added “use strict”
   statement to your provided code and: Bam! It worked.
 * I am very happy with with the plugin and the good support!
 * A buddy of mine who’s good with js/php is going to look into FFMPEG, GIF to MP4,
   WEBM(vp9) conversion based on this plugin. If you want i can send you the code
   when tested and finished.
 * Cheers!
 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/#post-6421282)
 * Great. Glad I could help out. And feel free to [donate any amount you feel like](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kylegilman@gmail.com&item_name=Video%20Embed%20And%20Thumbnail%20Generator%20Plugin%20Donation)
   to support future development.
 * If you get GIF conversions working I’d be happy to see the code. I’ve been thinking
   about it a little and in principle it’s pretty simple. My main question is why
   would you do that though?
 *  Thread Starter [vuewer](https://wordpress.org/support/users/vuewer/)
 * (@vuewer)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/#post-6421285)
 * Hi Kyle,
 * While im waiting for the paid version, i donated 10USD, just for the gesture :).
 * The main reason of gif to video conversion is the size. A simple and short gif
   can easily be 24MB in size, if you convert it to webm/mp4 its like 2MB for the
   same file (10%). If you look at sites like imgur.com or 9gag.com, they do that
   also already.
 * As example [http://i.imgur.com/MauOtlK.gifv](http://i.imgur.com/MauOtlK.gifv)
 * if you click the download link (right under) you’ll download the original uploaded
   gif file (40MB)
    Now if you inspect the element in your browser you see that 
   you are actually looking at a webm file and fallback to mp4 for non supported
   devices/browsers. If you download that webm its just 3.4MB.
 * Thanks again!
 *  Plugin Author [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * (@kylegilman)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/#post-6421286)
 * You’ll be waiting a while for the paid version, so thanks a lot for the donation
   in the meantime.
 * I hadn’t considered the size issue. GIFs are a terrible way to compress video
   so that makes a lot of sense.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Infinite scroll (Callback)’ is closed to new replies.

 * ![](https://ps.w.org/video-embed-thumbnail-generator/assets/icon.svg?rev=2965979)
 * [Videopack](https://wordpress.org/plugins/video-embed-thumbnail-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/video-embed-thumbnail-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/video-embed-thumbnail-generator/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Kyle Gilman](https://wordpress.org/support/users/kylegilman/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/infinite-scroll-callback-1/#post-6421286)
 * Status: resolved