Skip to content

feat(core): delay initial HTTP fallback for first segments#521

Open
mrlika wants to merge 8 commits intomainfrom
feat/initial-http-fallback-delay
Open

feat(core): delay initial HTTP fallback for first segments#521
mrlika wants to merge 8 commits intomainfrom
feat/initial-http-fallback-delay

Conversation

@mrlika
Copy link
Copy Markdown
Member

@mrlika mrlika commented Apr 13, 2026

Description

Introduce a configurable httpDownloadInitialTimeoutMs parameter that delays falling back to HTTP for the very first segments in the hybrid loader. This delay provides the P2P tracker (and WebRTC dialing) enough time to connect. If a connection is established inside that time window, segments will be loaded via P2P.

Changes Included

  • Add httpDownloadInitialTimeoutMs configurable in StreamConfig. Defaults to 0.
  • hybrid-loader.ts delays HTTP queue processing until the timeout triggers.
  • Implemented state tracking to clear delays safely on stream termination.

@mrlika mrlika requested a review from DimaDemchenko April 13, 2026 22:17
@mrlika mrlika force-pushed the feat/initial-http-fallback-delay branch from b6e3302 to cb5bc0e Compare April 13, 2026 22:18
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.

2 participants