Skip to content

fix(playback): await video readiness and prepare frames before cuts - #187

Merged
dazzatronus merged 2 commits into
shotstack:mainfrom
bfreskura:fix/video-playback-readiness
Sep 15, 2026
Merged

dazzatronus merged 2 commits into
shotstack:mainfrom
bfreskura:fix/video-playback-readiness

Conversation

@bfreskura

@bfreskura bfreskura commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Why this change was needed:

Browser previews can flash stale frames after changing a video's trim or speed and seeking backward. A runtime trace showed loadEdit() returning while replacement videos were still loading.

What changed:

  • Include newly created players in the promises awaited by reconcileInitial().
  • Suppress video playback updates during loading and seek to the current source time before creating the sprite.
  • Prepare future clips after backward seeks, including during playback, and avoid redundant seeks to prepared frames.
  • Add regression tests for awaited loading, loading-time playback suppression, backward seeks, and activation without a redundant seek.

The equivalent local patch was confirmed to resolve the reported playback glitch in the consuming application using SDK 2.17.0, including trim/speed changes with incremental updates and subsequent loops.

Problem solved:

Fresh initialization now waits for player readiness, and future video clips prepare their required frames before their cuts. Trim and speed changes continue to use the existing incremental update path.

@dazzatronus
dazzatronus merged commit 6295fa9 into shotstack:main Sep 15, 2026
1 check passed
@dazzatronus

Copy link
Copy Markdown
Contributor

@bfreskura thanks for reporting and providing a fix.

github-actions Bot pushed a commit that referenced this pull request Sep 15, 2026
## [2.19.5](v2.19.4...v2.19.5) (2026-09-15)

### Bug Fixes

* **playback:** await video readiness and prepare frames before cuts ([#187](#187)) ([6295fa9](6295fa9))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.19.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bfreskura
bfreskura deleted the fix/video-playback-readiness branch September 15, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants