• 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

How do you pause videos in a scenario where videos are selected via dropdown?

[Solved]

Foliovision › Forums › FV Player › How to … › How do you pause videos in a scenario where videos are selected via dropdown?

  • Peter 5 years, 6 months ago

    I have a scenario where I have videos in different languages that the user can bring up when choosing an option from a JS dropdown selection box. My question – Is there a way to pause a video when another selection is made if it was clicked for playing. For instance, let’s say the user selects an “English” option. My English video is loaded via the FV shortcode, then the user clicks play. But then they decide they want to load the “Chinese” video instead. So they do that, but the English video is still playing in the background. How do you get the previous video to pause when another video is selected. Here is my code.

    <style>
    .inv {
    display: none;
    }
    </style>
    <select id=”target” class=”lang_select”>
    <option value=”” selected=”selected”>Select</option>
    <option value=”ar”>Arabic</option>
    <option value=”zh”>Chinese</option>
    <option value=”en”>English</option>
    <option value=”jp”>Japanese</option>
    <option value=”ko”>Korean</option>
    <option value=”ru”>Russian</option>
    </select>
    <div id=”ar” class=”inv”>[fvplayer id="1"]</div>
    <div id=”zh” class=”inv”>[fvplayer id="2"]</div>
    <div id=”en” class=”inv”>[fvplayer id="3"]</div>
    <div id=”jp” class=”inv”>[fvplayer id="4"]</div>
    <div id=”ko” class=”inv”>[fvplayer id="5"]</div>
    <div id=”ru” class=”inv”>[fvplayer id="6"]</div>
    </div>
    <script>
    document
    .getElementById(‘target’)
    .addEventListener(‘change’, function (){
    ‘use strict’;
    var vis = document.querySelector(‘.vis’),
    target = document.getElementById(this.value);
    if (vis !== null) {
    vis.className = ‘inv’;
    }
    if (target !== null ) {
    target.className = ‘vis’;
    }
    });
    </script>

Viewing 4 replies - 1 through 4 (of 4 total)
  • Juraj Kacaba 6 years ago
    Avatar photo

    Hello Peter,

    Thanks for reaching out to us!

    Please check if you have Multiple videos playback option turned on in your settings. If yes, please turn it off.

    Thanks,
    Juraj

    Peter 6 years ago

    Yes, the multi playback was turned off. I was just wondering how to pass the function through my js to also pause or stop a video if its already playing when they switch languages.

    Juraj Kacaba 6 years ago
    Avatar photo

    Hello Peter,

    Here’s our Programmers guide. There’s a guide on how to add custom scripts into your theme and use FV Player’s API.

    Thanks,
    Juraj

    Martin 5 years ago

    Hello Peter,

    by default only one video should be allowed to play in FV Player. How are you starting the playback if it allows some other video to play in background?

    Thanks,
    Martin

Viewing 4 replies - 1 through 4 (of 4 total)
Reply To: How do you pause videos in a scenario where videos are selected via dropdown?



Please Sign in or Register to upload files.

Related Posts

  1. Let users loop your videos as they like

  2. Serving Private Videos with Amazon S3

  3. New Foliopress WYSIWYG version with Dropdown Customization

    New Foliopress WYSIWYG version with Dropdown Customization

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‬