Dont fully close audio player on error

This gives users the ability to change the selected language if
the error was related to language / voice.
This commit is contained in:
Jackson Harper 2022-12-01 12:50:57 +08:00
parent 983e15bdda
commit 3e4f9409df
2 changed files with 6 additions and 2 deletions

View file

@ -346,6 +346,10 @@
if let itemAudioProperties = self.audioController.itemAudioProperties {
playerContent(itemAudioProperties)
.tint(.appGrayTextContrast)
.alert("There was an error playing back your audio.",
isPresented: $audioController.playbackError) {
Button("Dismiss", role: .none) {}
}
} else {
EmptyView()
}

View file

@ -120,7 +120,7 @@
}
public func stopWithError() {
stop()
pause()
playbackError = true
}
@ -667,7 +667,7 @@
@objc func fireTimer() {
if let player = player {
if player.error != nil || player.currentItem?.error != nil {
stop()
stopWithError()
}
if let durations = durations {