[251124] fix: PlayerPanel,VideoPlayer 최적화-2
🕐 커밋 시간: 2025. 11. 24. 17:35:58 📊 변경 통계: • 총 파일: 4개 • 추가: +84줄 • 삭제: -8줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/components/VideoPlayer/TReactPlayer.jsx ~ com.twin.app.shoptime/src/components/VideoPlayer/VideoPlayer.js ~ com.twin.app.shoptime/src/reducers/playReducer.js ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx 🔧 주요 변경 내용: • UI 컴포넌트 아키텍처 개선 • 핵심 비즈니스 로직 개선 • 소규모 기능 개선
This commit is contained in:
@@ -159,11 +159,19 @@ export default function TReactPlayer({
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
const videoNode = playerRef.current?.getInternalPlayer();
|
||||
if (videoNode && videoNode.pause) {
|
||||
console.log('[VIDEO-DEBUG] 🧹 비디오 정리 (URL 변경 또는 언마운트)');
|
||||
videoNode.pause();
|
||||
videoNode.src = '';
|
||||
videoNode.srcObject = null;
|
||||
if (videoNode) {
|
||||
try {
|
||||
// VideoPlayer.js에서 이미 처리하므로 최소한 정리만
|
||||
if (videoNode.pause) {
|
||||
videoNode.pause();
|
||||
}
|
||||
// 중복 정리 방지를 위해 조건 더 엄격하게
|
||||
if (typeof videoNode.stopVideo === 'function' && videoNode.stopVideo !== videoNode.pause) {
|
||||
videoNode.stopVideo();
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[TReactPlayer] cleanup warning:', err);
|
||||
}
|
||||
}
|
||||
};
|
||||
}, [url]); // ✅ URL 변경 시에도 정리 로직 실행
|
||||
|
||||
Reference in New Issue
Block a user