mirror of
https://github.com/cranci1/Sora.git
synced 2026-05-08 11:10:31 +00:00
fixed progress saving
Some checks are pending
Build and Release IPA / Build IPA and Mac Catalyst (push) Waiting to run
Some checks are pending
Build and Release IPA / Build IPA and Mac Catalyst (push) Waiting to run
This commit is contained in:
parent
2b8b93d3d1
commit
a679dffa66
2 changed files with 7 additions and 1 deletions
Binary file not shown.
|
|
@ -58,6 +58,12 @@ struct CustomMediaPlayer: View {
|
||||||
self.title = title
|
self.title = title
|
||||||
self.episodeNumber = episodeNumber
|
self.episodeNumber = episodeNumber
|
||||||
self.onWatchNext = onWatchNext
|
self.onWatchNext = onWatchNext
|
||||||
|
|
||||||
|
let lastPlayedTime = UserDefaults.standard.double(forKey: "lastPlayedTime_\(fullUrl)")
|
||||||
|
if lastPlayedTime > 0 {
|
||||||
|
let seekTime = CMTime(seconds: lastPlayedTime, preferredTimescale: 1)
|
||||||
|
self._player.wrappedValue.seek(to: seekTime)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
|
@ -146,7 +152,7 @@ struct CustomMediaPlayer: View {
|
||||||
.padding(.horizontal, 32)
|
.padding(.horizontal, 32)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
if duration - currentTime <= duration * 0.10 && currentTime != 0 {
|
if duration - currentTime <= duration * 0.10 && currentTime != duration {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
player.pause()
|
player.pause()
|
||||||
presentationMode.wrappedValue.dismiss()
|
presentationMode.wrappedValue.dismiss()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue