• 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 to detect play event only for main video but not pre- or post-roll

[Solved]

Foliovision › Forums › FV Player › How to … › How to detect play event only for main video but not pre- or post-roll

  • Gerald 1 year, 4 months ago

    Hi,

    we have a system where we use the player api and JS events to track if a video was played and finished and then load some success-animations on the page.

    But we noticed that if e.g. a pre-roll is set for a video, the finish event is triggered by it and not the main video. This is not something we want. Is there any way to only look for events (play, finish, etc.) for the main video?

    Best regards,
    Robert

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

    Hello Robert,

    The second argument of the event handlers for events like ready or finish event handler is api, as seen in the ready event sample code in our JavaScript Guide

    flowplayer( function(api,root) {
      api.bind('ready', function( e, api, video ) {
        ...

    You can check typeof api.video.click and it should be undefined if it’s not the video ad.

    Thanks,
    Martin

    Gerald 1 year ago

    Hello Martin,

    thank you for the reply and info.
    Checking for

    if( typeof(api.video.click) == 'undefined' ) { ... }

    seems to work to get the main video. Although it seems a little odd, that the the main video is returning undefined whereas the pre-roll returns the video object.

    But nonetheless this solves our issue.

    Thanks,
    Robert

    Martin 1 year ago

    Hello Robert,

    The api.video is always there, it’s just that click property of the object that’s part of video ads only.

    Thanks,
    Martin

    Gerald 1 year ago

    Okay, I see. Thanks for clarifying.

Viewing 4 replies - 1 through 4 (of 4 total)
Reply To: How to detect play event only for main video but not pre- or post-roll



Please Sign in or Register to upload files.

Related Posts

  1. Setting up VAST player with both pre-roll and post-roll ads

    Setting up VAST player with both pre-roll and post-roll ads

  2. Tracking Video Play Events Based on the Post/Page

    Tracking Video Play Events Based on the Post/Page

  3. Custom Video Ads in FV Player (pre-roll and post-roll)

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‬