[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:
2025-11-24 17:35:58 +09:00
parent 97ac10c675
commit 372334fdfc
4 changed files with 84 additions and 8 deletions

View File

@@ -1896,9 +1896,17 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
// 자막 Blob URL 수명 관리: 이전 Blob을 해제해 메모리 누수 방지
useEffect(() => {
const prevBlobUrl = previousSubtitleBlobRef.current;
if (prevBlobUrl && prevBlobUrl !== currentSubtitleBlob && typeof prevBlobUrl === 'string') {
if (prevBlobUrl.startsWith('blob:')) {
// 더 엄격한 타입과 형식 체크
if (prevBlobUrl &&
typeof prevBlobUrl === 'string' &&
prevBlobUrl.startsWith('blob:') &&
prevBlobUrl !== currentSubtitleBlob) {
try {
URL.revokeObjectURL(prevBlobUrl);
dlog('[PlayerPanel] Previous subtitle Blob URL revoked:', prevBlobUrl);
} catch (error) {
derror('[PlayerPanel] Failed to revoke Blob URL:', error);
}
}
@@ -1907,7 +1915,12 @@ const PlayerPanel = ({ isTabActivated, panelInfo, isOnTop, spotlightId, ...props
return () => {
const lastBlobUrl = previousSubtitleBlobRef.current;
if (lastBlobUrl && typeof lastBlobUrl === 'string' && lastBlobUrl.startsWith('blob:')) {
URL.revokeObjectURL(lastBlobUrl);
try {
URL.revokeObjectURL(lastBlobUrl);
dlog('[PlayerPanel] Final subtitle Blob URL revoked:', lastBlobUrl);
} catch (error) {
derror('[PlayerPanel] Failed to revoke final Blob URL:', error);
}
}
previousSubtitleBlobRef.current = null;
};