Skip to content

[Feature] core.Video: request headers and a separate audio stream #681

Open

Description

@houko

Context

core.Video takes one Source URL (core/video.go:15). The backends open it as is (internal/platform/apple/video.go videoURL/URLWithString, internal/platform/windows/video.go videoURL). There is no way to send request headers (Referer, User-Agent, Cookie) with it, and no way to give a separate audio stream.

Why it matters

Streaming a video from a site rather than a downloaded file needs one or both: Bilibili's media URLs refuse requests without its Referer, and YouTube and Bilibili serve DASH, where video and audio are separate streams; only HLS manifests play as one URL. Kando's "subtitle-only" films (audio transcribed, the video streamed when watched) can therefore play only a YouTube HLS stream, on macOS.

Proposal

  • Video.Headers map[string]string, sent with every request for the source (AVURLAssetHTTPHeaderFieldsKey on Apple, a custom media source/HTTP stack on Windows, Android and GStreamer).
  • Video.AudioSource string, a second stream played in sync with Source (AVMutableComposition on Apple, MediaPlayer with a merged source on Windows, MergingMediaSource on Android).

Acceptance

  • A video whose host requires a Referer plays when Headers sets it.
  • A DASH-style pair of video and audio URLs plays in sync with seeking.

Activity

  1. self-assigned this
    on Nov 20, 2026
  2. houko commented on Nov 20, 2026

    @houko
    CollaboratorAuthor

    I audited #681 against the current backend contract. core.Video and driver.VideoConfig still have one source URL and no request headers or second audio source. Supporting the proposal requires coordinated media-source changes across Apple, Windows, Android, Linux and web backends, plus synchronization and seek tests. I did not submit a partial core-only API that would compile without working backends, so the feature remains open for a cross-target implementation.

  3. houko commented on Nov 21, 2026

    @houko
    CollaboratorAuthor

    Another use case for this issue, from Kando: playing a film straight from a NAS (SMB or SFTP) without downloading it first.

    Today VideoConfig only has Source string (internal/driver/mount.go:1448-1461). So the app has to run a loopback HTTP server with Range support and a token, and hand core.Video that URL. On Android that also needs a cleartext exception (#1061).

    Request headers, as proposed here, would let the token move out of the URL. A way for the app to supply the bytes itself would remove the loopback server altogether. That could be a Source that is an io.ReaderAt plus size and content type, which the platform reads through AVAssetResourceLoaderDelegate on Apple and a MediaDataSource on Android.

  4. houko commented on Nov 22, 2026

    @houko
    CollaboratorAuthor

    I audited #681 against origin/main at 091984681 and the live child PRs.

    • Apple finite HTTP headers are merged in #1771, and synchronized separate audio is merged in #1651. #1818 adds the remaining Apple header propagation for a separate audio asset and is open/mergeable.
    • Android headers are merged in #1647. Linux headers are merged in #1787.

    Current source still lacks the proposed synchronized AudioSource implementation on Windows, Linux, Android, web and Windows/web header coverage for adaptive media. HLS or DASH segment authorization and physical device playback remain open in the roadmap. I am leaving #681 open for those remaining backend and adaptive-stream acceptance items and keeping #1818 as the focused Apple follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions