parent
9dcecf0734
commit
5f7337bcdc
|
@ -174,6 +174,16 @@ final class ContentPlayerPlayManager: NSObject, ObservableObject {
|
|||
}
|
||||
}
|
||||
|
||||
func playSelectedContent(content: AudioContentPlaylistContent) {
|
||||
if content.id != id {
|
||||
generateUrl(contentId: content.id) { [unowned self] url in
|
||||
self.urlGenerateSuccess(content: content, url: url)
|
||||
} onFailure: {
|
||||
self.playPreviousContent()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func urlGenerateSuccess(content: AudioContentPlaylistContent, url: String) {
|
||||
id = content.id
|
||||
title = content.title
|
||||
|
|
|
@ -66,6 +66,9 @@ struct ContentPlayerView: View {
|
|||
)
|
||||
)
|
||||
.cornerRadius(6.7)
|
||||
.onTapGesture {
|
||||
playerManager.playSelectedContent(content: item)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue