[251125] fix: Memory Monitoring - 2
🕐 커밋 시간: 2025. 11. 25. 23:01:53 📊 변경 통계: • 총 파일: 1개 • 추가: +8줄 • 삭제: -10줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerPanel.jsx 🔧 주요 변경 내용: • 코드 정리 및 최적화 Performance: 코드 최적화로 성능 개선 기대
This commit is contained in:
@@ -381,24 +381,22 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// 재생 중 15초마다 메모리 모니터링
|
// 재생 중 15초마다 메모리 모니터링
|
||||||
const lastMemoryLogTimeRef = useRef(0);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const mediaState = videoPlayer.current?.getMediaState();
|
const memoryLogInterval = setInterval(() => {
|
||||||
|
const mediaState = videoPlayer.current?.getMediaState();
|
||||||
|
|
||||||
// 재생 중인지 확인 (duration > 0이고 paused가 아님)
|
// 재생 중인지 확인 (duration > 0이고 paused가 아님)
|
||||||
if (mediaState?.duration > 0 && !mediaState?.paused && currentTime > 0) {
|
if (mediaState?.duration > 0 && !mediaState?.paused && mediaState?.currentTime > 0) {
|
||||||
const now = Date.now();
|
|
||||||
// 마지막 로그 이후 15초 이상 경과했으면 로깅
|
|
||||||
if (now - lastMemoryLogTimeRef.current >= 15000) {
|
|
||||||
memoryMonitor.current.logMemory('[Video Playing]', {
|
memoryMonitor.current.logMemory('[Video Playing]', {
|
||||||
currentTime: (mediaState?.currentTime ?? 0).toFixed(2),
|
currentTime: (mediaState?.currentTime ?? 0).toFixed(2),
|
||||||
duration: (mediaState?.duration ?? 0).toFixed(2),
|
duration: (mediaState?.duration ?? 0).toFixed(2),
|
||||||
buffered: (mediaState?.proportionLoaded ?? 0).toFixed(2),
|
buffered: (mediaState?.proportionLoaded ?? 0).toFixed(2),
|
||||||
});
|
});
|
||||||
lastMemoryLogTimeRef.current = now;
|
|
||||||
}
|
}
|
||||||
}
|
}, 15000); // 15초마다 체크
|
||||||
}, [currentTime]);
|
|
||||||
|
return () => clearInterval(memoryLogInterval);
|
||||||
|
}, []);
|
||||||
|
|
||||||
// PlayerPanel.jsx의 라인 313-327 useEffect 수정 - detailPanelClosed flag 감지 추가
|
// PlayerPanel.jsx의 라인 313-327 useEffect 수정 - detailPanelClosed flag 감지 추가
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user