[251103] fix: VideoPlayer,MediaPlayer warning resolved

🕐 커밋 시간: 2025. 11. 03. 21:02:13

📊 변경 통계:
  • 총 파일: 5개
  • 추가: +54줄
  • 삭제: -5줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/actions/playActions.js
  ~ com.twin.app.shoptime/src/components/MediaPlayer/MediaKnob.js
  ~ com.twin.app.shoptime/src/components/MediaPlayer/MediaSlider.js
  ~ com.twin.app.shoptime/src/views/DetailPanel/ProductContentSection/ProductVideo/ProductVideo.v2.jsx
  ~ com.twin.app.shoptime/src/views/HomePanel/HomeBanner/HomeBanner.jsx

🔧 주요 변경 내용:
  • 핵심 비즈니스 로직 개선
  • UI 컴포넌트 아키텍처 개선
  • 소규모 기능 개선
This commit is contained in:
2025-11-03 21:02:14 +09:00
parent ac76c5d3ac
commit 3601ce890b
5 changed files with 54 additions and 5 deletions

View File

@@ -43,6 +43,7 @@ import {
requestPlayControl,
startVideoPlayer,
startVideoPlayerNew,
clearAllVideoTimers,
} from '../../../actions/playActions';
import CustomImage from '../../../components/CustomImage/CustomImage';
// import TButtonScroller from "../../../components/TButtonScroller/TButtonScroller";
@@ -106,6 +107,27 @@ export default function HomeBanner({
logPrefix: "[HomeBanner-VideoMove]",
});
// 🔽 컴포넌트 언마운트 시 비디오 리소스 정리
useEffect(() => {
return () => {
console.log('[HomeBanner] 컴포넌트 언마운트 - 비디오 리소스 정리');
cleanup();
// 전역 비디오 타이머 정리 (메모리 누수 방지)
clearAllVideoTimers();
// 백그라운드 비디오 정지
if (window.mediaPlayer && window.mediaPlayer._controller) {
try {
window.mediaPlayer._controller.pause();
console.log('[HomeBanner] 백그라운드 비디오 정지 완료');
} catch (error) {
console.warn('[HomeBanner] 백그라운드 비디오 정지 실패:', error);
}
}
};
}, [cleanup]);
const selectTemplate = useMemo(() => {
return homeTopDisplayInfo.shptmTmplCd;
}, [homeTopDisplayInfo.shptmTmplCd]);