feat(sia-video-source): expose source info - #1199
Merged
Merged
Conversation
- Mirror accepted source metadata into Video.js state - Extend shared features with React and lifecycle coverage
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:29
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 a
siaSourceInfoFeaturefor metadata returned with SOURCE_OK.The feature exposes container, MIME, tracks, duration, and MSE mode through
selectSiaSourceInfoanduseSiaSourceInfo(). It clears metadata when the source changes or detaches.Summary
This PR adds source information exposure to the Sia video source for Video.js v10 players. It surfaces the typed
SourceInfopayload the worker already sends onSOURCE_OKthrough a new DOM event, a player store feature/selector, and a React hook — with no protocol changes.What changed
New
sia-source-info-changeevent on the hostSiaVideoSourcenow emits a typedsia-source-info-changeDOM event on both its own EventTarget and the attached<video>element.{ active: true, info }— emitted exactly once when the current request'sSOURCE_OKacknowledges the load, carrying the exactSourceInfothe worker vouched for (container,mime,mode, track codecs,durationSeconds— which may benull).{ active: false }— emitted exactly once at every load boundary: fresh source/load,reloadConfiguration/reattach replay, recovery restart, detach, and destroy.SOURCE_OKreplies from re-opening or leaking info across loads.SourceInfopayload is treated as immutable and forwarded without mutation.New shared player feature + selector
siaSourceInfoFeatureandselectSiaSourceInfofor non-React Video.js stores.sourceInfokey as{ active: false } | { active: true; info }, avoiding key collisions with the existing recovery feature's top-levelactivekey in the flat player store.infoleak.New React hook
useSiaSourceInfo()behind/react, reading the exact same selector slice as non-React consumers.Shared
siaFeaturestuple extendedsiaFeaturesis now a mutable tuple of all three features:[siaRecoveryFeature, siaLoadFeature, siaSourceInfoFeature].combine(...)and ReactcreatePlayer({ features: siaFeatures }).Docs
durationSeconds, which may benull, and a clear note that an open window means the worker pipeline accepted the source — not that the load is playable/ready.Tests
@videojs/react.