콘텐츠 플레이어

- 재생목록 아이템 터치시 해당 아이템을 재생하는 기능 추가
This commit is contained in:
Yu Sung 2025-02-26 14:38:59 +09:00
parent 9dcecf0734
commit 5f7337bcdc
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -66,6 +66,9 @@ struct ContentPlayerView: View {
)
)
.cornerRadius(6.7)
.onTapGesture {
playerManager.playSelectedContent(content: item)
}
}
}
}