streaming edits

This commit is contained in:
Forrest 2026-08-13 11:29:11 -04:00
parent 0a7af1d813
commit db33f0764b
3 changed files with 62 additions and 15 deletions

View file

@ -302,11 +302,25 @@ class SubsonicClient {
/// manager, which fetches these bytes to disk). `maxBitRate == 0` means
/// original / no transcode; [format] requests a specific transcode container
/// (e.g. `mp3`, `opus`), or null for the server default / original.
Uri streamUri(String id, {int maxBitRate = 0, String? format}) =>
///
/// [estimateContentLength] asks the server to send an (estimated)
/// `Content-Length` header even for on-the-fly transcodes. Transcoded
/// responses are otherwise chunked with no length and no byte ranges, so the
/// native player reports `duration == null`, never reaches `ready`, and the
/// playhead freezes at 0:00 (then restarts). Only meaningful when transcoding
/// (`maxBitRate > 0` or a [format]); original streams already carry a real
/// length.
Uri streamUri(
String id, {
int maxBitRate = 0,
String? format,
bool estimateContentLength = false,
}) =>
_uri('stream', {
'id': id,
if (maxBitRate > 0) 'maxBitRate': '$maxBitRate',
if (format != null && format.isNotEmpty) 'format': format,
if (estimateContentLength) 'estimateContentLength': 'true',
});
/// Signed cover-art URL. [size] is clamped to Subsonic's 32–2048 range.