feat(sia-video-source): add feature preset - #1198
Merged
Merged
Conversation
- Bundle recovery and load features for shared composition - Verify non-React and React Video.js integration
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
pcfreak30
marked this pull request as ready for review
September 24, 2026 20:08
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.
Adds
siaFeatures, a mutable tuple containing recovery and load features.It can be passed to
combine(...)orcreatePlayer(...)and spread intovideoFeatures.Summary
This PR adds a shared feature preset to
libs/sia-video-source: a singlesiaFeaturestuple that combines the two existing Sia player features (siaRecoveryFeatureandsiaLoadFeature) so consumers can wire both features into a Video.js player in one step — whether they use the non-React store API or ReactcreatePlayer.What’s changed
New
sia-features.tsmoduleSiaFeatures, an explicitly typed mutable tuple[PlayerFeature<SiaRecoveryState>, PlayerFeature<SiaLoadState>].siaFeatures, the shared tuple (recovery first, then load).as const: ReactcreatePlayerrequires mutable feature arrays, whilecombine(...)accepts either.Root package export
siaFeaturesandSiaFeaturesare re-exported from the package root, mirroring howvideoFeaturesis shipped by the video.js stack.Works with both consumption APIs
createStore()(combine(...siaFeatures))assembles a store containing both slices.createPlayer({ features: siaFeatures })(or a composition like[...videoFeatures, ...siaFeatures]) drives both existing hooks (useSiaRecovery/useSiaLoad) from the same player store.Documentation
Tests
combine(...siaFeatures)seeds both slices inert, updates each slice only on its own event, and resets both on detach.@videojs/react<Player>built withfeatures: siaFeaturesand proves both hooks read/update the same store.@videojs/react(non-React consumers can importsiaFeatureswithout React installed).@videojs/reactdeliberately unresolvable.createPlayeraccepts the tuple and[...videoFeatures, ...siaFeatures].as consttuple correctly fails TS2769, protecting the mutable-tuple requirement.The result is a single, pre-composed features preset for the Sia video source that removes the need to assemble the two features separately across vanilla and React consumers.