mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-20 08:02:16 +00:00
idk but this should work
Some checks failed
Build and Release IPA / Build IPA (push) Has been cancelled
Some checks failed
Build and Release IPA / Build IPA (push) Has been cancelled
This commit is contained in:
parent
083946699d
commit
7c5e116b4c
2 changed files with 4 additions and 1 deletions
|
|
@ -181,6 +181,7 @@ struct CustomMediaPlayer: View {
|
|||
.foregroundColor(subtitleFGColor)
|
||||
.cornerRadius(5)
|
||||
.shadow(color: Color.black, radius: CGFloat(subtitleShadowRadius))
|
||||
.padding(.bottom, showControls ? 80 : 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue