• Aryan Noshirvnai's avatar
    Stream audio directly instead of downloading the whole file first · ab7b741e
    Aryan Noshirvnai authored
    Every stream endpoint (library, soundmarks, posts, live-location, rooms)
    only accepted the access token via an Authorization header - fine for
    apiFetch, but <audio src="..."> can't send custom headers, so the frontend
    was fetching the entire file as a blob before playback could even start
    (no progressive playback, no seeking). Added
    get_current_user_for_stream, which accepts the token as a ?token= query
    param too (same reasoning as the Rooms websocket fix), and switched all
    five stream endpoints to it. FileResponse already supports Range requests
    natively, so a direct <audio src> now gets real 206 Partial Content
    responses - confirmed live (curl -H "Range: ..." against
    /library/stream/1?token=...).
    Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
    ab7b741e
test_library.py 7.47 KB