콘텐츠 상세 미리듣기 버튼 변경

This commit is contained in:
Yu Sung
2026-01-19 21:18:14 +09:00
parent 68dab028cc
commit f1353fc2e6
5 changed files with 6327 additions and 6241 deletions

View File

@@ -82,13 +82,29 @@ struct ContentDetailPlayView: View {
}
}
Image(isPlaying() ? "btn_audio_content_pause" : isAlertPreview ? "btn_audio_content_preview_play" : "btn_audio_content_play")
.onTapGesture {
ContentPlayerPlayManager.shared.resetPlayer()
if isPlaying() {
if isPlaying() {
Image("btn_audio_content_pause")
.onTapGesture {
ContentPlayerPlayManager.shared.resetPlayer()
contentPlayManager.pauseAudio()
} else {
}
} else {
if isAlertPreview {
HStack(spacing: 4) {
Image("ic_noti_play")
.resizable()
.frame(width: 24, height: 24)
Text(I18n.ContentDetail.preview)
.font(.custom(Font.medium.rawValue, size: 16.7))
.foregroundColor(Color.white)
}
.padding(.vertical, 13.3)
.frame(minWidth: 212)
.background(Color.black.opacity(0.4))
.cornerRadius(46.7)
.onTapGesture {
ContentPlayerPlayManager.shared.resetPlayer()
contentPlayManager.startTimer = startTimer
contentPlayManager.stopTimer = stopTimer
@@ -110,7 +126,32 @@ struct ContentDetailPlayView: View {
creatorNickname: audioContent.creator.nickname
)
}
} else {
Image("btn_audio_content_play")
.onTapGesture {
ContentPlayerPlayManager.shared.resetPlayer()
contentPlayManager.startTimer = startTimer
contentPlayManager.stopTimer = stopTimer
contentPlayManager.playAudio(
contentId: audioContent.contentId,
title: audioContent.title,
nickname: audioContent.creator.nickname,
coverImage: audioContent.coverImageUrl,
contentUrl: audioContent.contentUrl,
isFree: audioContent.price <= 0,
isPreview: !audioContent.existOrdered && audioContent.price > 0
)
recentContentViewModel.insertRecentContent(
contentId: Int64(audioContent.contentId),
coverImageUrl: audioContent.coverImageUrl,
title: audioContent.title,
creatorNickname: audioContent.creator.nickname
)
}
}
}
if !isAlertPreview {
Image("ic_player_next_10")
@@ -122,12 +163,19 @@ struct ContentDetailPlayView: View {
}
}
} else if audioContent.releaseDate == nil {
Text("해당 콘텐츠는 크리에이터의 요청으로\n미리듣기를 제공하지 않습니다.")
.font(.custom(Font.medium.rawValue, size: 16.7))
.foregroundColor(Color.grayee)
.padding(13.3)
.background(Color.gray33.opacity(0.5))
.cornerRadius(46.7)
HStack(spacing: 4) {
Image("ic_no_preview")
.resizable()
.frame(width: 24, height: 24)
Text(I18n.ContentDetail.noPreview)
.font(.custom(Font.medium.rawValue, size: 16.7))
.foregroundColor(Color(hex: "444446"))
}
.padding(.vertical, 13.3)
.frame(minWidth: 212)
.background(Color.white.opacity(0.5))
.cornerRadius(46.7)
}
VStack(alignment: .leading, spacing: 13.3) {