[251119] fix: VideoPlayer

🕐 커밋 시간: 2025. 11. 19. 05:41:52

📊 변경 통계:
  • 총 파일: 4개
  • 추가: +28줄
  • 삭제: -14줄

📝 수정된 파일:
  ~ com.twin.app.shoptime/src/actions/playActions.js
  ~ com.twin.app.shoptime/src/components/VideoPlayer/TReactPlayer.jsx
  ~ com.twin.app.shoptime/src/hooks/useVideoPlay/useVideoPlay.js
  ~ com.twin.app.shoptime/src/views/PlayerPanel/PlayerTabContents/v2/LiveChannelNext.module.less

🔧 주요 변경 내용:
  • 핵심 비즈니스 로직 개선
  • UI 컴포넌트 아키텍처 개선
  • 소규모 기능 개선
This commit is contained in:
2025-11-19 05:41:53 +09:00
parent e5ec726fba
commit 2cffe6f0a9
4 changed files with 28 additions and 14 deletions

View File

@@ -341,6 +341,15 @@ export const useVideoPlay = (options = {}) => {
const isPlaying = currentOwnerId && currentOwnerId.endsWith('_player');
const currentBanner = currentOwnerId ? currentOwnerId.replace('_player', '') : null;
// 🔽 [최적화] 배너 가용성 메모이제이션 (반복 계산 방지)
const bannerAvailability = useMemo(
() => ({
banner0: isBannerAvailable('banner0'),
banner1: isBannerAvailable('banner1'),
}),
[isBannerAvailable]
);
// 🔽 디버그 정보 (단순화)
const getDebugInfo = useCallback(
() => ({
@@ -349,12 +358,9 @@ export const useVideoPlay = (options = {}) => {
isPlaying,
errorCount,
videoState: videoState.getDebugInfo(),
bannerAvailability: {
banner0: isBannerAvailable('banner0'),
banner1: isBannerAvailable('banner1'),
},
bannerAvailability,
}),
[currentOwnerId, currentBanner, isPlaying, errorCount, isBannerAvailable]
[currentOwnerId, currentBanner, isPlaying, errorCount, bannerAvailability]
);
return {
@@ -371,6 +377,7 @@ export const useVideoPlay = (options = {}) => {
isPlaying,
currentBanner,
bannerVisibility,
bannerAvailability, // ✅ [최적화] 메모이제이션된 배너 가용성
// 🔍 유틸리티
isBannerAvailable,