core icon indicating copy to clipboard operation
core copied to clipboard

Bug Report: pause and currentframe Events Emitting Constantly

Open kdelac opened this issue 10 months ago • 1 comments

I am using version 2.0.2, and I noticed that:

  • The currentFrame event emits continuously even if the Composition is empty.
  • When registering event listeners for all events, both pause and currentFrame emit constantly, even when no playback is happening.
  • In version 1.6.0, currentFrame and pause events only emit when expected

Steps to Reproduce

  1. Install and use version 2.0.2.
  2. Register listeners all events.
  3. Ensure the Composition is empty.
  4. Observe that currentframe still emits.
  5. Observe that pause emits repeatedly when all events are registered.

Environment Version: 2.0.2 (bug exists) / 1.6.0 (working correctly) Framework/Platform: Angular Browser/OS: Chrome 132/Windows 11

kdelac avatar Feb 12 '25 13:02 kdelac

This behavior is intentional. In V2, we replaced the event-based rendering system—which only updated the composition in response to changes—with a periodic update approach. During playback, the composition updates at the target frame rate (30 FPS), and when playback is stopped, it updates every 200ms.

The primary reason for this change is to better support automated video editing, which requires handling a large number of editing operations efficiently. In V1, the event-driven update system caused excessive GPU load due to frequent event propagations. By switching to periodic updates, we have decoupled GPU pressure from the number of editing operations, resulting in better performance and scalability.

k9p5 avatar Feb 14 '25 11:02 k9p5