mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Dont display loading indicator if audio is not playing when voice is changed
This commit is contained in:
parent
5bb0b1246b
commit
247fcf0eb3
3 changed files with 7 additions and 3 deletions
|
|
@ -32,7 +32,7 @@ struct TextToSpeechLanguageView: View {
|
|||
Spacer()
|
||||
|
||||
if audioController.defaultLanguage == language.key {
|
||||
if audioController.isLoading {
|
||||
if audioController.isPlaying, audioController.isLoading {
|
||||
ProgressView()
|
||||
} else {
|
||||
Image(systemName: "checkmark")
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ struct TextToSpeechVoiceSelectionView: View {
|
|||
Spacer()
|
||||
|
||||
if voice.selected {
|
||||
if audioController.isLoading {
|
||||
if audioController.isPlaying, audioController.isLoading {
|
||||
ProgressView()
|
||||
} else {
|
||||
Image(systemName: "checkmark")
|
||||
|
|
|
|||
|
|
@ -525,6 +525,10 @@ public class AudioController: NSObject, ObservableObject, AVAudioPlayerDelegate
|
|||
return (state == .loading || player?.currentItem == nil || player?.currentItem?.status == .unknown)
|
||||
}
|
||||
|
||||
public var isPlaying: Bool {
|
||||
state == .playing
|
||||
}
|
||||
|
||||
public func isLoadingItem(itemID: String) -> Bool {
|
||||
if state == .reachedEnd {
|
||||
return false
|
||||
|
|
@ -533,7 +537,7 @@ public class AudioController: NSObject, ObservableObject, AVAudioPlayerDelegate
|
|||
}
|
||||
|
||||
public func isPlayingItem(itemID: String) -> Bool {
|
||||
state == .playing && itemAudioProperties?.itemID == itemID
|
||||
itemAudioProperties?.itemID == itemID && isPlaying
|
||||
}
|
||||
|
||||
public func skipForward(seconds: Double) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue