Skip to content
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

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

lastcanal
Copy link
Collaborator

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

@CLAassistant
Copy link

CLAassistant commented Sep 17, 2024

CLA assistant check
All committers have signed the CLA.

@algora-pbc algora-pbc bot mentioned this pull request Sep 17, 2024
@zcesur zcesur changed the base branch from vidstack-llhls to main September 17, 2024 12:06
@zcesur zcesur force-pushed the vidstack-llhls-preload-hint branch from 989c6f5 to 21617ca Compare September 17, 2024 12:08
@zcesur
Copy link
Member

zcesur commented Sep 17, 2024

Works great, thanks a lot for the PR & demo!

@zcesur zcesur merged commit f7062e6 into algora-io:main Sep 17, 2024
1 check passed
@@ -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;
Copy link

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.

Copy link

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.

lastcanal added a commit to lastcanal/tv that referenced this pull request Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants