• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Foliovision

  • Weblog
    • FV Player
    • WordPress
    • Video of the Week
    • Case Studies
    • Business
  • About
    • Testimonials
    • Meet the Team
    • We Support
    • Careers
    • Contact
    • Pricing
  • Products
  • Support
    • FV Player Docs
    • Pro Support
  • Login
  • Basket is empty
Affordable VAST/VPAID for Wordpress has arrived. Serve ads with your videos starting today!
    • Docs
      • Installation
      • Changelog
    • FAQ
    • Support
      • Free Support
      • Pro Support
    • PRO

    Dynamic Content Loading

    Some themes load content using Ajax calls. This is typically used for infinity scrolling and rarely also for the actual navigation on the website.

    • Getting FV Player to load
    • Loading the dynamically added players
    • Problems with JavaScript events?
    • Autoplay

    Getting FV Player to load

    FV Player only loads the scripts if there was a [fvplayer] shortcode used anywhere in the loop, in the widgets or in PHP code.

    If the FV Player is not there and you intend to load content using Ajax make sure you enable wp-admin -> FV Player -> Settings -> Integrations/Compatibility -> “Load FV Flowplayer JS everywhere” to make sure the FV Player library is loaded on all pages.

    A much better option is to put this code to the page template where you need FV Player:

    do_action( 'fv_player_force_load_assets');

    That way the JavaScript only loads where it’s necessary.

    Loading the dynamically added players

    FV Player does detect jQuery Ajax calls and will initialize any new players that might be added to the page as a result of the Ajax.

    jQuery(document).ajaxComplete( function() {  
      fv_player_load();
    });

    However if you are not using jQuery for your Ajax you must provide your own hook. Here’s how it works with WPLMS:

    document.addEventListener( 'unit_loaded', function(){
      setTimeout( fv_player_load, 100 );
    });

    unit_loaded is the WPLMS JavaScript event which occurs when loading a new lesson. The timeout is there to make sure the player has been already appended to HTML as the event seems to trigger before the HTML is updated.

    Problems with JavaScript events?

    If there is no JavaScript event to hook into, here’s the last resort – this effectively looks for new FV Player every second and loads it:

    setInterval( fv_player_load, 1000 );

    FV Player could be doing this automatically, or it could be an advanced integration option.

    Autoplay

    If you would like the new appended players to also autoplay, here’s the code:

    document.addEventListener( 'YOUR-EVENT_NAME', function(){
      setTimeout( function() {
        fv_player_load();
    
        // Normally only one autoplay is allowed per page, this unlocks autoplay
        fv_player_did_autoplay = false;
        fv_autoplay_exec();
        jQuery('[data-fvautoplay]').removeAttr('data-fvautoplay');
      }, 100 );
    });

    Allowing autoplay for Ajax loaded content can get problematic if you run these Ajax calls while the main video is still playing.

    Primary Sidebar

    For Developers

    1. Why FV Player?
    2. FAQ
    3. Creating and Managing Playlists
    4. Advanced features
    5. Video Security
    6. Troubleshooting
    7. Tools
    8. Analytics
    9. Audio Player
    10. Live Streaming
    11. Download | Buy
    12. Getting Started
    13. Licensing and Account
    14. Setting Screens
    15. Video Hosting
    16. Video Membership, Pay Per View and eLearning
    17. Video Advertising
    18. FV Player VAST/VPAID
    19. Casting Options
    20. For Developers
      1. FV Player 8 Changes
      2. FV Player Database
      3. Lightbox Customizations
      4. List of Shortcode Parameters
      5. Video Custom Fields
      6. AMP
      7. Minify Plugins
      8. API | Programmer's Guide
      9. JavaScript Guide
      10. Dynamic Content Loading
      11. Video Position Saving
      12. Changelog
      13. How to add your own URL token signing mechanism
      14. How to change FV Player Translations and Labels
    21. FV Player Demos
    22. Additional Services
    23. Legal

    Footer

    Our Plugins

    • FV WordPress Flowplayer
    • FV Thoughtful Comments
    • FV Simpler SEO
    • FV Antispam
    • FV Gravatar Cache
    • FV Testimonials

    Free Tools

    • Pandoc Online
    • Article spinner
    • WordPress Password Finder
    • Delete LinkedIn Account
    • Responsive Design Calculator
    Foliovision logo
    All materials © 2026 Foliovision s.r.o. | Panská 12 - 81101 Bratislava - Slovakia | info@foliovision.com
    • This Site Uses Cookies
    • Privacy Policy
    • Terms of Service
    • Site Map
    • Contact
    • Tel. ‭+421 2/5292 0086‬