feat(live-room): 라이브 캡쳐 녹화 허용 설정을 생성 시청 흐름에 반영한다

This commit is contained in:
Yu Sung
2026-03-30 21:49:34 +09:00
parent 3a4df173d2
commit 178e0849dc
8 changed files with 97 additions and 3 deletions

View File

@@ -716,6 +716,10 @@ enum I18n {
static var joinAllowed: String { pick(ko: "가능", en: "Allowed", ja: "可能") }
static var joinNotAllowed: String { pick(ko: "불가능", en: "Not allowed", ja: "不可") }
static var captureRecordingSetting: String { pick(ko: "캡쳐/녹화 허용", en: "Capture/recording", ja: "キャプチャ/録画") }
static var captureRecordingAllowed: String { pick(ko: "가능", en: "Allowed", ja: "可能") }
static var captureRecordingNotAllowed: String { pick(ko: "불가능", en: "Not allowed", ja: "不可") }
//
static var allAges: String { pick(ko: "전체 연령", en: "All ages", ja: "全年齢") }
static var over19: String { pick(ko: "19세 이상", en: "19+", ja: "R-18") }

View File

@@ -24,4 +24,5 @@ struct CreateLiveRoomRequest: Encodable {
var menuPan: String = ""
var isActiveMenuPan: Bool = false
var isAvailableJoinCreator: Bool = true
var isCaptureRecordingAvailable: Bool = false
}

View File

@@ -14,4 +14,5 @@ struct GetRecentRoomInfoResponse: Decodable {
let coverImagePath: String
let numberOfPeople: Int
let genderRestriction: LiveRoomCreateViewModel.GenderRestriction
let isCaptureRecordingAvailable: Bool?
}

View File

@@ -182,7 +182,32 @@ struct LiveRoomCreateView: View {
}
.frame(width: screenSize().width - 26.7)
.padding(.top, 33.3)
VStack(spacing: 13.3) {
Text(I18n.CreateLive.captureRecordingSetting)
.appFont(size: 16.7, weight: .bold)
.foregroundColor(Color.grayee)
.frame(width: screenSize().width - 26.7, alignment: .leading)
HStack(spacing: 13.3) {
SelectedButtonView(
title: I18n.CreateLive.captureRecordingAllowed,
isActive: true,
isSelected: viewModel.isCaptureRecordingAvailable
)
.onTapGesture { viewModel.isCaptureRecordingAvailable = true }
SelectedButtonView(
title: I18n.CreateLive.captureRecordingNotAllowed,
isActive: true,
isSelected: !viewModel.isCaptureRecordingAvailable
)
.onTapGesture { viewModel.isCaptureRecordingAvailable = false }
}
}
.frame(width: screenSize().width - 26.7)
.padding(.top, 33.3)
if shouldShowAdultSetting {
AdultSettingView()
.frame(width: screenSize().width - 26.7)

View File

@@ -100,6 +100,7 @@ final class LiveRoomCreateViewModel: ObservableObject {
@Published var selectedMenu: SelectedMenu? = nil
@Published var isAvailableJoinCreator = true
@Published var isCaptureRecordingAvailable = false
private let repository = LiveRepository()
private var subscription = Set<AnyCancellable>()
@@ -146,6 +147,7 @@ final class LiveRoomCreateViewModel: ObservableObject {
self.coverImagePath = data.coverImagePath
self.numberOfPeople = String(data.numberOfPeople)
self.genderRestriction = data.genderRestriction
self.isCaptureRecordingAvailable = data.isCaptureRecordingAvailable ?? false
self.errorMessage = I18n.CreateLive.recentDataLoaded
self.isShowPopup = true
@@ -192,7 +194,8 @@ final class LiveRoomCreateViewModel: ObservableObject {
menuPanId: isActivateMenu ? menuId : 0,
menuPan: isActivateMenu ? menu : "",
isActiveMenuPan: isActivateMenu,
isAvailableJoinCreator: isAvailableJoinCreator
isAvailableJoinCreator: isAvailableJoinCreator,
isCaptureRecordingAvailable: isCaptureRecordingAvailable
)
if timeSettingMode == .RESERVATION {

View File

@@ -29,6 +29,7 @@ struct GetRoomInfoResponse: Decodable {
let creatorLanguageCode: String?
let isActiveRoulette: Bool
let isChatFrozen: Bool?
let isCaptureRecordingAvailable: Bool?
let isPrivateRoom: Bool
let password: String?
}

View File

@@ -80,7 +80,15 @@ struct LiveRoomViewV2: View {
}
private var shouldEnforceScreenCaptureProtection: Bool {
!(isCurrentUserHost || isCurrentUserStaff)
guard let liveRoomInfo = viewModel.liveRoomInfo else {
return true
}
if liveRoomInfo.isCaptureRecordingAvailable == true {
return false
}
return !(isCurrentUserHost || isCurrentUserStaff)
}
var body: some View {
@@ -956,6 +964,9 @@ struct LiveRoomViewV2: View {
.onChange(of: viewModel.liveRoomInfo?.managerList) { _ in
syncScreenCaptureProtectionState()
}
.onChange(of: viewModel.liveRoomInfo?.isCaptureRecordingAvailable) { _ in
syncScreenCaptureProtectionState()
}
.onChange(of: viewModel.isChatFrozenForCurrentUser) { isFrozen in
if isFrozen {
hideKeyboard()