-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vidstack llhls with Preload Hint #96
Conversation
989c6f5
to
21617ca
Compare
Works great, thanks a lot for the PR & demo! |
@@ -229,6 +231,16 @@ const Hooks = { | |||
this.player.streamType = opts.is_live ? "ll-live:dvr" : "on-demand"; | |||
this.player.src = opts.url; | |||
|
|||
this.player.addEventListener("provider-change", (event) => { | |||
const provider = event.detail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for commenting on a closed PR, but trying to understand how this works.
Since provider
goes out of scope in line 241, does setting the target latency have any effect?
Maybe I'm missing something, but AFAICT, this event listener doesn't do anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think I understand: the listener is being passed a reference to the MediaProviderAdapter
which this function mutates.
This PR vendors and activates (via Vidstack) the feature/preload-hint branch of HLS.js that implements
X-PRELOAD-HINT
.Even though
X-PRELOAD-HINT
is supported by the Pipeline, the default setup of Vidstack does not exercise any of the preload hint code. This change will prevent stalls by moving the parsing of manifests and connection negotiation for new segments out of the 'critical path' of requesting new segments from the network.Here is a demo showing the difference between Vidstack's default implementation and Vidstack with the
feature/preload_hint
branch of HLS.js. You'll notice in the waterfall for the new version that requests for partial segments are held open until the segment is ready, instead of waiting to parse the new manifest before requesting the segment.Screencast.from.2024-09-16.17-21-36.webm
/claim #91