idk but this should work
Some checks failed
Build and Release IPA / Build IPA (push) Has been cancelled

This commit is contained in:
cranci1 2025-02-16 16:23:05 +01:00
parent 083946699d
commit 7c5e116b4c
2 changed files with 4 additions and 1 deletions

View file

@ -181,6 +181,7 @@ struct CustomMediaPlayer: View {
.foregroundColor(subtitleFGColor)
.cornerRadius(5)
.shadow(color: Color.black, radius: CGFloat(subtitleShadowRadius))
.padding(.bottom, showControls ? 80 : 0)
}
}

View file

@ -55,14 +55,16 @@ class VTTSubtitlesLoader: ObservableObject {
}
let startTime = parseTimecode(times[0].trimmingCharacters(in: .whitespaces))
let adjustedStartTime = max(startTime - 0.5, 0)
let endTime = parseTimecode(times[1].trimmingCharacters(in: .whitespaces))
let adjusteEndTime = max(endTime - 0.5, 0)
index += 1
var cueText = ""
while index < lines.count && !lines[index].trimmingCharacters(in: .whitespaces).isEmpty {
cueText += lines[index] + "\n"
index += 1
}
cues.append(SubtitleCue(startTime: startTime, endTime: endTime, text: cueText.trimmingCharacters(in: .whitespacesAndNewlines)))
cues.append(SubtitleCue(startTime: adjustedStartTime, endTime: adjusteEndTime, text: cueText.trimmingCharacters(in: .whitespacesAndNewlines)))
}
return cues
}