optimize the appicon of iOS

This commit is contained in:
2026-08-26 17:14:59 +08:00
parent 76b0332035
commit bb677ea8cf
11 changed files with 406 additions and 11 deletions

View File

@@ -93,6 +93,10 @@ final class PlayerController: ObservableObject {
player.pause()
}
func setVolume(_ volume: Float) {
player.volume = volume
}
func togglePlayPause() {
if player.timeControlStatus == .playing {
pause()
@@ -135,8 +139,10 @@ final class PlayerController: ObservableObject {
return false
}
let position = snapshot.positionMs
let target = item.sentences.reversed().first { $0.startMs < position - 250 }
?? item.sentences.first
guard let target = item.sentences.reversed().first(where: { $0.startMs < position - 250 })
?? item.sentences.first else {
return false
}
seek(to: target.startMs)
return true
}
@@ -255,7 +261,7 @@ final class PlayerController: ObservableObject {
func showTransientMessage(_ message: String) {
transientMessage = message
transientTask?.cancel()
transientTask = Task { [weak self] in
transientTask = Task { @MainActor [weak self] in
try? await Task.sleep(nanoseconds: 1_500_000_000)
guard !Task.isCancelled else {
return