Expand description
HTTP Range-backed seekable byte source.
Used for YouTube Music (and any other URL where the server returns
Accept-Ranges: bytes). Unlike crate::stream_buffer::StreamBuffer,
this never downloads the file linearly — every miss in the rolling
window cache becomes a Range: bytes=N-M request. Symphonia can seek
freely: to the end (Matroska Cues), to scrub targets, anywhere.
Architecture:
- One rolling 512 KiB window, anchored at
chunk_start. seek()is a constant-time pointer move.read()fetches a fresh window only whenposfalls outside the currently-cached window. Sequential playback stays inside the window 90%+ of the time.- HTTP calls happen via
reqwest::blockinginside whatever thread is callingRead::read— callers MUST already be on a blocking-friendly thread (spawn_blockingor similar).
byte_len() is determined once upfront from Content-Range of the
initial probe fetch. If the server doesn’t include it, we fall back to
a HEAD request. If both fail, this source can’t be constructed.