• 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

Understanding JS API

[Solved]

Foliovision › Forums › FV Player › Troubleshooting › Understanding JS API

  • miksmusic 3 years, 9 months ago

    Hi,

    I have a page with several players on it.

    This code works:

    if( typeof(flowplayer) != "undefined" ) { 
      flowplayer( function(api,root) {
        api.bind('ready', function() {
          alert( 'Video duration is '+api.video.duration );
        });
      });
    }

    But something simple like this does not (getting api is not defined error):

    var api = flowplayer(0);
    api.load();

    Just want to load the api for an arbitrary player (in this example the first player on the page) and start the playback.

    What am I missing? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Martin 4 years ago

    Hello miksmusic,

    do you run that code on page load? If so, try to run in only once FV Player has finished loading

    document.addEventListener( 'fv_player_loaded', function() {
      ...
    });

    This is required as FV Player only loads once user starts interacting with the page. You can disable this by unchecking Settings -> FV Player -> Integrations/Compatibility -> “Optimize FV Flowplayer JS loading”.

    Thanks,
    Martin

    miksmusic 4 years ago

    Thank you!
    That works great. However, I had to switch to version 7.4 due to another issue. Does 7.4 have a similar trigger I can use?

    Martin 4 years ago

    Hello miksmusic,

    unfortunately it was only around since 7.5.0.727.

    Here’s what you posted regarding FV Player 7.5 and 7.4:

    I managed to improve the overall performance but there’s a bizarre issue I can’t quite understand. Seems to be related to v.7.5 only.

    In short, if I have a number of players preloaded on a page and if i start playing the media one by one, eventually it will stop loading (only load with a considerable delay like 2-3 minutes or more). It’s somewhat random but seems to be happening more often after playing a larger file.

    All media links are correct.

    The first click always loads fine, not matter the file size.

    Downgrading to 7.4 fixes the loading issue but 7.4 lacks the js events that I’m using elsewhere on the site, so ideally would prefer to stay with 7.5.

    Please let us know what you did to improve the performance. What exact issue were you trying to solve?

    Thanks,
    Martin

    Martin 4 years ago

    Hello miksmusic,

    actually I found your new forum thread about the issue here: https://foliovision.com/support/fv-wordpress-flowplayer/troubleshooting/slow-loading-media-in-certain-cases-in-v-7-5-works-in-7-4#post-160939

    Thank you for posting that! Let’s continue there.

    Martin

Viewing 4 replies - 1 through 4 (of 4 total)
Reply To: Understanding JS API



Please Sign in or Register to upload files.

Related Posts

  1. u.__play is not a function FV Player Pro ver 0.3

    u.__play is not a function FV Player Pro ver 0.3

  2. How use the ‘finish’ event?

    How use the ‘finish’ event?

  3. Understanding vimeo caching

    Understanding vimeo caching

Primary Sidebar

Troubleshooting

    Categories

    • Business
    • Camera Reviews
    • Case Studies
    • Design
    • FV Player
    • Internet Marketing
    • IT
    • Life
    • SEO
    • Slovak
    • Video of the Week
    • WordPress

    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‬