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

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

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "ic_no_preview.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

File diff suppressed because it is too large Load Diff

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") if isPlaying() {
.onTapGesture { Image("btn_audio_content_pause")
ContentPlayerPlayManager.shared.resetPlayer() .onTapGesture {
ContentPlayerPlayManager.shared.resetPlayer()
if isPlaying() {
contentPlayManager.pauseAudio() 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.startTimer = startTimer
contentPlayManager.stopTimer = stopTimer contentPlayManager.stopTimer = stopTimer
@@ -110,7 +126,32 @@ struct ContentDetailPlayView: View {
creatorNickname: audioContent.creator.nickname 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 { if !isAlertPreview {
Image("ic_player_next_10") Image("ic_player_next_10")
@@ -122,12 +163,19 @@ struct ContentDetailPlayView: View {
} }
} }
} else if audioContent.releaseDate == nil { } else if audioContent.releaseDate == nil {
Text("해당 콘텐츠는 크리에이터의 요청으로\n미리듣기를 제공하지 않습니다.") HStack(spacing: 4) {
.font(.custom(Font.medium.rawValue, size: 16.7)) Image("ic_no_preview")
.foregroundColor(Color.grayee) .resizable()
.padding(13.3) .frame(width: 24, height: 24)
.background(Color.gray33.opacity(0.5))
.cornerRadius(46.7) 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) { VStack(alignment: .leading, spacing: 13.3) {

View File

@@ -86,6 +86,22 @@ enum I18n {
ja: "固定上限到達" ja: "固定上限到達"
) )
} }
static var preview: String {
pick(
ko: "미리듣기",
en: "Preview",
ja: "試聴"
)
}
static var noPreview: String {
pick(
ko: "미리듣기 미지원",
en: "No Preview",
ja: "試聴非対応"
)
}
static var pinLimitDesc: String { static var pinLimitDesc: String {
pick( pick(