From 95db60c2ddfa99216bbe05d6731ecda5cc09999a Mon Sep 17 00:00:00 2001 From: optrader Date: Tue, 11 Nov 2025 12:58:52 +0900 Subject: [PATCH] =?UTF-8?q?debug:=20ProductVideoV2=20=ED=81=B4=EB=A6=AD=20?= =?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EC=83=81=EC=84=B8=20=EB=A1=9C?= =?UTF-8?q?=EA=B9=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ๐ŸŽฌ ํƒœ๊ทธ๋ฅผ ๋ถ™์ธ ์ƒ์„ธํ•œ ์ฝ˜์†” ๋กœ๊ทธ ์ถ”๊ฐ€: - handleThumbnailClick: ์ธ๋„ค์ผ ํด๋ฆญ ๊ฐ์ง€ - handleVideoPlayerClick: ๋น„๋””์˜ค ์žฌ์ƒ ์ค‘ ํด๋ฆญ ๊ฐ์ง€ ๋ฐ ์ƒํƒœ ๊ฒ€์‚ฌ - handleVideoPlayerMouseDown: MouseDown ์ด๋ฒคํŠธ ๊ฐ์ง€ - toggleFullscreen: ์ „์ฒดํ™”๋ฉด ํ† ๊ธ€ ์ƒํƒœ ๋ณ€ํ™” - videoPlayerWrapper onClick/onMouseDownCapture: wrapper ๋ ˆ๋ฒจ ์ด๋ฒคํŠธ - normalContainerRef onClick/onMouseDownCapture: ์ปจํ…Œ์ด๋„ˆ ๋ ˆ๋ฒจ ์ด๋ฒคํŠธ ๊ฐ ๋กœ๊ทธ์—๋Š” ๋‹ค์Œ ์ •๋ณด ํฌํ•จ: - ํ˜„์žฌ isPlaying, isFullscreen ์ƒํƒœ - ์ด๋ฒคํŠธ ํƒ€์ž… (type, target ๋“ฑ) - ์กฐ๊ฑด ๋งŒ์กฑ ์—ฌ๋ถ€ ๐Ÿค– Generated with Claude Code Co-Authored-By: Claude --- .../ProductVideo/ProductVideo.v2.jsx | 74 +++++++++++++++++-- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/com.twin.app.shoptime/src/views/DetailPanel/ProductContentSection/ProductVideo/ProductVideo.v2.jsx b/com.twin.app.shoptime/src/views/DetailPanel/ProductContentSection/ProductVideo/ProductVideo.v2.jsx index 6b2f7b01..5db5be57 100644 --- a/com.twin.app.shoptime/src/views/DetailPanel/ProductContentSection/ProductVideo/ProductVideo.v2.jsx +++ b/com.twin.app.shoptime/src/views/DetailPanel/ProductContentSection/ProductVideo/ProductVideo.v2.jsx @@ -142,8 +142,13 @@ export default function ProductVideoV2({ // ์ธ๋„ค์ผ ํด๋ฆญ ํ•ธ๋“ค๋Ÿฌ - ๋น„๋””์˜ค ์žฌ์ƒ ์‹œ์ž‘ + Redux dispatch + MediaPlayer ๋ฉ”์„œ๋“œ ํ˜ธ์ถœ const handleThumbnailClick = useCallback(() => { + console.log('๐ŸŽฌ [handleThumbnailClick] ์ธ๋„ค์ผ ํด๋ฆญ๋จ', { + canPlayVideo, + isPlaying, + }); if (canPlayVideo && !isPlaying) { // console.log('[BgVideo] ProductVideoV2 - Starting video playback'); + console.log('๐ŸŽฌ [handleThumbnailClick] โœ… ๋น„๋””์˜ค ์žฌ์ƒ ์‹œ์ž‘'); setIsPlaying(true); // ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ „์ฒดํ™”๋ฉด ๋น„๋””์˜ค ์ผ์‹œ์ •์ง€ @@ -237,7 +242,13 @@ export default function ProductVideoV2({ // ์ „์ฒดํ™”๋ฉด ํ† ๊ธ€ ํ•ธ๋“ค๋Ÿฌ const toggleFullscreen = useCallback(() => { - setIsFullscreen((prev) => !prev); + setIsFullscreen((prev) => { + console.log('๐ŸŽฌ [toggleFullscreen] ํ† ๊ธ€ ์‹คํ–‰', { + prevIsFullscreen: prev, + newIsFullscreen: !prev, + }); + return !prev; + }); }, []); // ์ผ๋ฐ˜ ๋ชจ๋“œ์šฉ ํ‚ค๋ณด๋“œ ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ (์ปจํ…Œ์ด๋„ˆ์— ์ง์ ‘ ์—ฐ๊ฒฐ) @@ -259,14 +270,28 @@ export default function ProductVideoV2({ // ๋น„๋””์˜ค ์žฌ์ƒ ์ค‘ ํด๋ฆญ ํ•ธ๋“ค๋Ÿฌ - ์ „์ฒดํ™”๋ฉด ํ† ๊ธ€ const handleVideoPlayerClick = useCallback( (e) => { + console.log('๐ŸŽฌ [ProductVideoV2] handleVideoPlayerClick ์‹คํ–‰๋จ', { + isPlaying, + isFullscreen, + eventType: e.type, + target: e.target?.className, + currentTarget: e.currentTarget?.className, + }); + // ๋น„๋””์˜ค ์žฌ์ƒ ์ค‘์ด๊ณ  ์ „์ฒดํ™”๋ฉด์ด ์•„๋‹ ๋•Œ๋งŒ ์ž‘๋™ - if (!isPlaying || isFullscreen) return; + if (!isPlaying || isFullscreen) { + console.log('๐ŸŽฌ [ProductVideoV2] ์กฐ๊ฑด ๋ถˆ๋งŒ์กฑ - ๋ฐ˜ํ™˜๋จ', { + isPlaying, + isFullscreen, + }); + return; + } // ์ด๋ฒคํŠธ ์ „ํŒŒ ์ค‘๋‹จ (capture phase์—์„œ๋„ ์ค‘๋‹จ) e.preventDefault?.(); e.stopPropagation?.(); - console.log('[ProductVideoV2] Click detected - toggling fullscreen'); + console.log('๐ŸŽฌ [ProductVideoV2] โœ… Click detected - toggling fullscreen'); toggleFullscreen(); }, [isPlaying, isFullscreen, toggleFullscreen] @@ -275,14 +300,24 @@ export default function ProductVideoV2({ // ๋งˆ์šฐ์Šค ๋‹ค์šด (ํด๋ฆญ) ์ด๋ฒคํŠธ - capture phase์—์„œ ์ฒ˜๋ฆฌ const handleVideoPlayerMouseDown = useCallback( (e) => { + console.log('๐ŸŽฌ [ProductVideoV2] handleVideoPlayerMouseDown ์‹คํ–‰๋จ', { + isPlaying, + isFullscreen, + eventType: e.type, + target: e.target?.className, + }); + // ๋น„๋””์˜ค ์žฌ์ƒ ์ค‘์ด๊ณ  ์ „์ฒดํ™”๋ฉด์ด ์•„๋‹ ๋•Œ๋งŒ ์ž‘๋™ - if (!isPlaying || isFullscreen) return; + if (!isPlaying || isFullscreen) { + console.log('๐ŸŽฌ [ProductVideoV2] MouseDown ์กฐ๊ฑด ๋ถˆ๋งŒ์กฑ'); + return; + } // capture phase์—์„œ ์ด๋ฒคํŠธ ์ฒ˜๋ฆฌ e.preventDefault(); e.stopPropagation(); - console.log('[ProductVideoV2] MouseDown detected at capture phase'); + console.log('๐ŸŽฌ [ProductVideoV2] โœ… MouseDown detected at capture phase'); }, [isPlaying, isFullscreen] ); @@ -402,15 +437,24 @@ export default function ProductVideoV2({ onTouchMove={handleUserActivity} onWheel={handleUserActivity} onClick={(e) => { + console.log('๐ŸŽฌ [videoPlayerWrapper] onClick ์‹คํ–‰๋จ', { + isFullscreen, + isPlaying, + eventType: e.type, + }); if (!isFullscreen) { handleVideoPlayerClick(e); } }} onMouseDownCapture={(e) => { + console.log('๐ŸŽฌ [videoPlayerWrapper] onMouseDownCapture ์‹คํ–‰๋จ', { + isFullscreen, + isPlaying, + }); if (!isFullscreen && isPlaying) { e.preventDefault(); e.stopPropagation(); - console.log('[ProductVideoV2] MouseDown at wrapper - capturing'); + console.log('๐ŸŽฌ [videoPlayerWrapper] MouseDown at wrapper - capturing'); } }} > @@ -490,8 +534,22 @@ export default function ProductVideoV2({
{ + console.log('๐ŸŽฌ [normalContainerRef] onClick ์‹คํ–‰๋จ', { + isPlaying, + isFullscreen, + eventType: e.type, + target: e.target?.className, + }); + handleVideoPlayerClick(e); + }} + onMouseDownCapture={(e) => { + console.log('๐ŸŽฌ [normalContainerRef] onMouseDownCapture ์‹คํ–‰๋จ', { + isPlaying, + isFullscreen, + }); + handleVideoPlayerMouseDown(e); + }} > {renderVideoPlayer()}