Add loading external subtitle files for media-source playback

Adds a "Load subtitle from file…" row to the Subtitles section on iOS
(document picker) and macOS (open panel), available when playing files
from local folder, SMB, or WebDAV sources. The picked file is copied
into the per-video temp subtitle directory, registered as a selectable
Caption (displayed by filename), and activated through the existing
loadCaption flow. The Subtitles tab and captions control button now
also appear for media-source files without any subtitles.
This commit is contained in:
Arkadiusz Fal
2026-07-30 23:59:26 +02:00
parent 6a0fe2fbbf
commit 8faf20c9e9
8 changed files with 238 additions and 4 deletions

View File

@@ -921,7 +921,7 @@ struct ControlsSectionRenderer: View {
@ViewBuilder
private var captionsButton: some View {
if actions.hasCaptions, actions.onCaptionSelected != nil {
if actions.hasCaptions || actions.canLoadExternalSubtitles, actions.onCaptionSelected != nil {
let subtitlesActive = actions.currentCaption != nil || actions.currentEmbeddedSubtitleTrackID != nil
controlButton(systemImage: subtitlesActive ? "captions.bubble.fill" : "captions.bubble") {
actions.onShowCaptionsSelector?()