diff --git a/com.twin.app.shoptime/src/components/VideoPlayer/TReactPlayer.jsx b/com.twin.app.shoptime/src/components/VideoPlayer/TReactPlayer.jsx index c35e839c..183a1eda 100644 --- a/com.twin.app.shoptime/src/components/VideoPlayer/TReactPlayer.jsx +++ b/com.twin.app.shoptime/src/components/VideoPlayer/TReactPlayer.jsx @@ -155,33 +155,8 @@ export default function TReactPlayer({ return events; }, [handleEvent, mediaEventsMap]); - // 🔽 [최적화] URL 변경 또는 언마운트 시 이전 비디오 정리 (메모리 누수 방지) - useEffect(() => { - return () => { - // console.log('[TReactPlayer] cleanup - start', { url }); - const videoNode = playerRef.current?.getInternalPlayer(); - if (videoNode) { - try { - // VideoPlayer.js에서 이미 처리하므로 최소한 정리만 - if (videoNode.pause) { - videoNode.pause(); - } - // 중복 정리 방지를 위해 조건 더 엄격하게 - if (typeof videoNode.stopVideo === 'function' && videoNode.stopVideo !== videoNode.pause) { - videoNode.stopVideo(); - } - // HLS 인스턴스가 존재하면 명시적으로 파괴 - const hls = playerRef.current?.getInternalPlayer?.('hls'); - if (hls && typeof hls.destroy === 'function') { - hls.destroy(); - } - } catch (err) { - console.warn('[TReactPlayer] cleanup warning:', err); - } - } - // console.log('[TReactPlayer] cleanup - done', { url }); - }; - }, [url]); // ✅ URL 변경 시에도 정리 로직 실행 + // 메모리 정리는 VideoPlayer.js componentWillUnmount에서 수행 + // TReactPlayer는 react-player 래퍼 역할만 수행 return (