fix(spf): fix async teardown leaks and recreate engine on src change#841
Merged
cjpillsbury merged 1 commit intomainfrom Mar 10, 2026
Merged
fix(spf): fix async teardown leaks and recreate engine on src change#841cjpillsbury merged 1 commit intomainfrom
cjpillsbury merged 1 commit intomainfrom
Conversation
Audit of playback engine orchestrations found several async tasks that could continue running (and mutating DOM/state) after destroy() was called. Fix teardown leaks: - setupMediaSource: abort waitForSourceOpen via AbortController on destroy - updateDuration: skip mediaSource.duration mutation if destroyed after await - endOfStream: skip runEvaluate if destroyed (guards mediaSource.endOfStream) - loadTextTrackCues: abort in-flight VTT fetch on cleanup (controller already existed but wasn't called from the returned cleanup function) Recreate engine on src change: - SpfMedia.src setter now destroys the current engine and creates a fresh one instead of patching presentation on the existing engine. This ensures all state, SourceBuffers, and in-flight requests from the previous source are fully torn down before the next source begins loading — matching the browser's own load algorithm semantics. The media element reference is preserved and re-applied to the new engine automatically.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
📦 Bundle Size Report🎨 @videojs/html(no changes) Presets (7)
Media (4)
Players (3)
Skins (14)
UI Components (21)
Sizes are marginal over the root entry point. ⚛️ @videojs/react(no changes) Presets (7)
Media (3)
Skins (14)
UI Components (17)
Sizes are marginal over the root entry point. 🧩 @videojs/core(no changes) Entries (5)
🏷️ @videojs/element(no changes) Entries (2)
📦 @videojs/store(no changes) Entries (3)
🔧 @videojs/utils(no changes) Entries (10)
📦 @videojs/spf(no changes) Entries (3)
ℹ️ How to interpretAll sizes are standalone totals (minified + brotli).
Run |
Merged
sampotts
pushed a commit
that referenced
this pull request
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audit of playback engine orchestrations found several async tasks that could continue running (and mutating DOM/state) after destroy() was called.
Fix teardown leaks:
Recreate engine on src change: