Skip to content

Commit 9161dd6

Browse files
authored
fix - QA 반영 (#59)
* fix(YoutubePlayer): 유튜브 자동재생 기능 오류 수정 * fix(MyTabView): topToggleTabs 내부 텍스트 및 여백 UI 수정 * feat(1.0.24): 버전 업데이트
1 parent 9b07d9f commit 9161dd6

3 files changed

Lines changed: 63 additions & 9 deletions

File tree

KillingPart.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@
434434
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
435435
CODE_SIGN_ENTITLEMENTS = KillingPart/KillingPart.entitlements;
436436
CODE_SIGN_STYLE = Automatic;
437-
CURRENT_PROJECT_VERSION = 23;
437+
CURRENT_PROJECT_VERSION = 24;
438438
DEAD_CODE_STRIPPING = YES;
439439
DEVELOPMENT_TEAM = GQ89YG5G9R;
440440
ENABLE_APP_SANDBOX = YES;
@@ -459,7 +459,7 @@
459459
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
460460
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
461461
MACOSX_DEPLOYMENT_TARGET = 14.0;
462-
MARKETING_VERSION = 1.0.23;
462+
MARKETING_VERSION = 1.0.24;
463463
PRODUCT_BUNDLE_IDENTIFIER = com.killingpoint.killingpart;
464464
PRODUCT_NAME = "$(TARGET_NAME)";
465465
REGISTER_APP_GROUPS = YES;
@@ -479,7 +479,7 @@
479479
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
480480
CODE_SIGN_ENTITLEMENTS = KillingPart/KillingPart.entitlements;
481481
CODE_SIGN_STYLE = Automatic;
482-
CURRENT_PROJECT_VERSION = 23;
482+
CURRENT_PROJECT_VERSION = 24;
483483
DEAD_CODE_STRIPPING = YES;
484484
DEVELOPMENT_TEAM = GQ89YG5G9R;
485485
ENABLE_APP_SANDBOX = YES;
@@ -504,7 +504,7 @@
504504
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
505505
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
506506
MACOSX_DEPLOYMENT_TARGET = 14.0;
507-
MARKETING_VERSION = 1.0.23;
507+
MARKETING_VERSION = 1.0.24;
508508
PRODUCT_BUNDLE_IDENTIFIER = com.killingpoint.killingpart;
509509
PRODUCT_NAME = "$(TARGET_NAME)";
510510
REGISTER_APP_GROUPS = YES;

KillingPart/Views/Screens/Main/Add/AddSearchDetail/components/YoutubePlayerView.swift

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ struct YoutubePlayerView: UIViewRepresentable {
124124
let shouldForceSeekJS = isRangeChanged ? "true" : "false"
125125
let playbackControlJS = isPlaying
126126
? """
127+
window.kpAutoplayAudioRestoreAttempted = false;
127128
if (window.kpApplyDesiredRange) {
128129
window.kpApplyDesiredRange(\(shouldForceSeekJS));
129130
if (window.kpScheduleAutoplayRetry) {
@@ -140,6 +141,11 @@ struct YoutubePlayerView: UIViewRepresentable {
140141
if (window.kpStopAutoplayRetry) {
141142
window.kpStopAutoplayRetry();
142143
}
144+
window.kpAutoplayMutedFallbackActive = false;
145+
window.kpAutoplayAudioRestoreAttempted = false;
146+
if (window.kpPlayer.unMute) {
147+
window.kpPlayer.unMute();
148+
}
143149
if (\(shouldForceSeekJS)) {
144150
window.kpPlayer.seekTo(window.kpDesiredStart, true);
145151
}
@@ -185,7 +191,6 @@ struct YoutubePlayerView: UIViewRepresentable {
185191
navigationAction.navigationType == .linkActivated
186192
|| navigationAction.navigationType == .formSubmitted
187193
|| navigationAction.navigationType == .formResubmitted
188-
|| navigationAction.targetFrame == nil
189194

190195
guard isUserNavigation else {
191196
decisionHandler(.allow)
@@ -267,6 +272,9 @@ struct YoutubePlayerView: UIViewRepresentable {
267272
window.kpAutoplayRetryCount = 0;
268273
window.kpAutoplayMaxRetryCount = 14;
269274
window.kpAutoplayRetryDelayMs = 220;
275+
window.kpAutoplayMuteFallbackAfterCount = 3;
276+
window.kpAutoplayMutedFallbackActive = false;
277+
window.kpAutoplayAudioRestoreAttempted = false;
270278
271279
window.kpStopAutoplayRetry = function() {
272280
if (window.kpAutoplayRetryTimer) {
@@ -308,6 +316,9 @@ struct YoutubePlayerView: UIViewRepresentable {
308316
window.kpPlayer.seekTo(targetStart, true);
309317
}
310318
319+
if (window.kpAutoplayMutedFallbackActive && window.kpPlayer.mute) {
320+
window.kpPlayer.mute();
321+
}
311322
window.kpPlayer.playVideo();
312323
};
313324
@@ -337,6 +348,13 @@ struct YoutubePlayerView: UIViewRepresentable {
337348
}
338349
339350
window.kpAutoplayRetryCount += 1;
351+
if (
352+
!window.kpAutoplayMutedFallbackActive
353+
&& window.kpAutoplayRetryCount >= window.kpAutoplayMuteFallbackAfterCount
354+
) {
355+
window.kpAutoplayMutedFallbackActive = true;
356+
window.kpAutoplayAudioRestoreAttempted = false;
357+
}
340358
window.kpScheduleAutoplayRetry(false);
341359
}, window.kpAutoplayRetryDelayMs);
342360
};
@@ -398,11 +416,16 @@ struct YoutubePlayerView: UIViewRepresentable {
398416
events: {
399417
onReady: function() {
400418
window.kpPlayerReady = true;
419+
window.kpAutoplayMutedFallbackActive = false;
420+
window.kpAutoplayAudioRestoreAttempted = false;
401421
if (window.kpShouldAutoplay) {
402422
window.kpApplyDesiredRange(true);
403423
window.kpStartRangeLoop();
404424
window.kpScheduleAutoplayRetry(true);
405425
} else {
426+
if (window.kpPlayer.unMute) {
427+
window.kpPlayer.unMute();
428+
}
406429
window.kpPlayer.seekTo(window.kpDesiredStart, true);
407430
window.kpPlayer.pauseVideo();
408431
}
@@ -415,6 +438,38 @@ struct YoutubePlayerView: UIViewRepresentable {
415438
416439
if (state === 1 || state === 3) {
417440
window.kpStopAutoplayRetry();
441+
if (
442+
window.kpAutoplayMutedFallbackActive
443+
&& !window.kpAutoplayAudioRestoreAttempted
444+
) {
445+
window.kpAutoplayAudioRestoreAttempted = true;
446+
setTimeout(function() {
447+
if (
448+
!window.kpShouldAutoplay
449+
|| !window.kpPlayer
450+
|| !window.kpPlayer.unMute
451+
) {
452+
return;
453+
}
454+
455+
window.kpPlayer.unMute();
456+
457+
var stateAfterUnmute = Number(
458+
window.kpPlayer.getPlayerState
459+
? window.kpPlayer.getPlayerState()
460+
: -1
461+
);
462+
if (stateAfterUnmute === 1 || stateAfterUnmute === 3) {
463+
window.kpAutoplayMutedFallbackActive = false;
464+
return;
465+
}
466+
467+
if (window.kpPlayer.mute) {
468+
window.kpPlayer.mute();
469+
}
470+
window.kpPlayer.playVideo();
471+
}, 160);
472+
}
418473
return;
419474
}
420475

KillingPart/Views/Screens/Main/My/MyTabView.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,13 @@ struct MyTabView: View {
6262
Picker("마이 탭", selection: segmentedSelectionBinding) {
6363
ForEach(MyTopTab.allCases, id: \.self) { tab in
6464
Text(tab.title)
65-
.font(AppFont.paperlogy6SemiBold(size: 16))
65+
.font(AppFont.paperlogy4Regular(size: 11))
6666
.tag(tab)
6767
}
6868
}
6969
.pickerStyle(.segmented)
7070
.controlSize(.large)
7171
.scaleEffect(x: 1, y: 1.08, anchor: .center)
72-
.padding(.vertical, AppSpacing.xs)
7372
.onAppear {
7473
configureSegmentedControlFontIfNeeded()
7574
}
@@ -108,8 +107,8 @@ struct MyTabView: View {
108107
guard !Self.hasConfiguredSegmentedControlAppearance else { return }
109108
Self.hasConfiguredSegmentedControlAppearance = true
110109

111-
let fallbackFont = UIFont.systemFont(ofSize: 15, weight: .semibold)
112-
let segmentFont = UIFont(name: "Paperlogy-6SemiBold", size: 15) ?? fallbackFont
110+
let fallbackFont = UIFont.systemFont(ofSize: 13, weight: .regular)
111+
let segmentFont = UIFont(name: "Paperlogy-4Regular", size: 13) ?? fallbackFont
113112

114113
UISegmentedControl.appearance().setTitleTextAttributes(
115114
[.font: segmentFont],

0 commit comments

Comments
 (0)