mirror of
https://github.com/yattee/yattee.git
synced 2026-07-20 22:32:01 +00:00
Apply audio mode to downloaded videos
Downloads bypass stream selection and reach play() as ready-made local file streams, so audio mode never affected them. Apply the mode at that choke point instead: swap a local video stream for the separately downloaded audio track, or play a muxed file with the video track disabled (vid set per-load in MPVClient, never toggled live). The transform is bidirectional so stored audio-only queue/history entries restore full video when the mode is off, and setAudioMode now reloads downloaded content at the current position in both directions.
This commit is contained in:
@@ -495,7 +495,13 @@ final class MPVBackend: PlayerBackend {
|
||||
|
||||
// Load the stream
|
||||
do {
|
||||
try mpvClient?.loadFile(stream.url, audioURL: audioStream?.url, httpHeaders: stream.httpHeaders, useEDL: useEDL)
|
||||
try mpvClient?.loadFile(
|
||||
stream.url,
|
||||
audioURL: audioStream?.url,
|
||||
httpHeaders: stream.httpHeaders,
|
||||
useEDL: useEDL,
|
||||
disableVideoTrack: stream.requiresVideoTrackDisabled
|
||||
)
|
||||
|
||||
// Give MPV a moment to process the loadfile command
|
||||
try await Task.sleep(for: .milliseconds(100))
|
||||
|
||||
Reference in New Issue
Block a user