• 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

Subtitles icon when loading with javascript

[Solved]

Foliovision › Forums › FV Player › How to … › Subtitles icon when loading with javascript

  • Michael 3 years, 3 months ago

    Hi,
    when we use WP shortcode with subtitles

    [fvplayer subtitles=""]

    it loads the video and there is a subtitles icon on the player.

    But when we use javascript to load a new video with this code:

    flowPlayer = jQuery(".flowplayer").data('flowplayer');
    flowPlayer.load([{mpegurl: url}]);

    And this event that loads the subtitles, we can see the subtitles active, but there is no icon on the player to turn it off.

    flowplayer( function(api,root) {
      api.on('ready', function(e,api,time) {
        let subTitles = "/wp-content/themes/subtitles/lectures/example.vtt"; 
        let subtitle_list = [
          {
            label: "English",
            lang: "en",
            src: subTitles
          }
        ];
        api.video.subtitles = subtitle_list;
        api.loadSubtitles(0); // subtitle index
      });
    });
Viewing 2 replies - 1 through 2 (of 2 total)
  • Martin 3 years ago

    Hello Michael,

    the subtitle menu is also created on the ready event, so it’s probably too late. Try moving your code to the load event and it might just work.

    Other than that I’m not sure why not simply provide the subtitles configuration in the load() call. I added a code sample to https://foliovision.com/player/developers/api-programming#js-usage -> “Here’s the code if you also need subtitles:”

    Thanks,
    Martin

    Michael 3 years ago

    Hi Martin, Thanks that worked.

    We didn’t know the exact parameter structure to use in the load() function, but with your example we made it work.

Viewing 2 replies - 1 through 2 (of 2 total)
Reply To: Subtitles icon when loading with javascript



Please Sign in or Register to upload files.

Related Posts

  1. Dynamic Content Loading

    Dynamic Content Loading

  2. FV Player Pro Not Loading Exoclick Banner Ad Overlay

    FV Player Pro Not Loading Exoclick Banner Ad Overlay

  3. Load flowplayer javascript everywhere option not working with dash

    Load flowplayer javascript everywhere option not working with dash

Primary Sidebar

How to …

    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‬