Skip to content

feat(sia-video-source): add feature preset - #1198

Merged
pcfreak30 merged 1 commit into
developfrom
feat/sia-video-source-features-preset
Sep 24, 2026
Merged

pcfreak30 merged 1 commit into
developfrom
feat/sia-video-source-features-preset

Conversation

@pcfreak30

@pcfreak30 pcfreak30 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Adds siaFeatures, a mutable tuple containing recovery and load features.

It can be passed to combine(...) or createPlayer(...) and spread into videoFeatures.


Summary

This PR adds a shared feature preset to libs/sia-video-source: a single siaFeatures tuple that combines the two existing Sia player features (siaRecoveryFeature and siaLoadFeature) so consumers can wire both features into a Video.js player in one step — whether they use the non-React store API or React createPlayer.

What’s changed

  • New sia-features.ts module

    • Exports SiaFeatures, an explicitly typed mutable tuple [PlayerFeature<SiaRecoveryState>, PlayerFeature<SiaLoadState>].
    • Exports siaFeatures, the shared tuple (recovery first, then load).
    • The tuple is deliberately not as const: React createPlayer requires mutable feature arrays, while combine(...) accepts either.
  • Root package export

    • siaFeatures and SiaFeatures are re-exported from the package root, mirroring how videoFeatures is shipped by the video.js stack.
  • Works with both consumption APIs

    • Non-React: createStore()(combine(...siaFeatures)) assembles a store containing both slices.
    • React: createPlayer({ features: siaFeatures }) (or a composition like [...videoFeatures, ...siaFeatures]) drives both existing hooks (useSiaRecovery / useSiaLoad) from the same player store.
  • Documentation

    • README section added with usage examples for both vanilla Video.js and React consumers, plus a note explaining why the tuple must stay mutable.

Tests

  • Store-level spec — verifies combine(...siaFeatures) seeds both slices inert, updates each slice only on its own event, and resets both on detach.
  • React binding spec — mounts a real @videojs/react <Player> built with features: siaFeatures and proves both hooks read/update the same store.
  • Declaration/type guard spec — ensures:
    • Root declarations never reference @videojs/react (non-React consumers can import siaFeatures without React installed).
    • A non-React consumer compiles with @videojs/react deliberately unresolvable.
    • React createPlayer accepts the tuple and [...videoFeatures, ...siaFeatures].
    • A readonly as const tuple 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.

- Bundle recovery and load features for shared composition
- Verify non-React and React Video.js integration
@kody-ai

kody-ai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@pcfreak30 pcfreak30 changed the title feat/sia video source features preset feat(sia-video-source): add feature preset Sep 24, 2026
@pcfreak30
pcfreak30 marked this pull request as ready for review September 24, 2026 20:08
@pcfreak30
pcfreak30 merged commit 13d4fbf into develop Sep 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant