algora-io / tv

Open source Twitch for developers
https://algora.tv
Other
1.07k stars 67 forks source link

Vidstack llhls with Preload Hint #96

Closed lastcanal closed 2 months ago

lastcanal commented 2 months ago

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 commented 2 months ago

CLA assistant check
All committers have signed the CLA.

zcesur commented 2 months ago

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