diff --git a/components/SearchLoadingAnimation.tsx b/components/SearchLoadingAnimation.tsx index e2ebbe5..b3c020e 100644 --- a/components/SearchLoadingAnimation.tsx +++ b/components/SearchLoadingAnimation.tsx @@ -10,9 +10,9 @@ interface SearchLoadingAnimationProps { onComplete?: (checkedSources: number, totalSources: number) => void; } -export function SearchLoadingAnimation({ - currentSource, - checkedSources = 0, +export function SearchLoadingAnimation({ + currentSource, + checkedSources = 0, totalSources = 16, isPaused = false, onComplete, @@ -54,7 +54,7 @@ export function SearchLoadingAnimation({ // Small delay to allow animation to settle const timeout = setTimeout(() => { onComplete(checkedSources, totalSources); - }, 300); + }, 100); return () => clearTimeout(timeout); } }, [isComplete, onComplete, checkedSources, totalSources]); @@ -78,7 +78,7 @@ export function SearchLoadingAnimation({ strokeLinecap="round" /> - + 正在搜索视频源{dots} @@ -86,19 +86,19 @@ export function SearchLoadingAnimation({ {/* Progress Bar - Unified 0-100% */}
+
{videoData.vod_content.replace(/<[^>]*>/g, '')}
)} diff --git a/components/player/VideoPlayer.tsx b/components/player/VideoPlayer.tsx index e5ae6e9..3af4d0d 100644 --- a/components/player/VideoPlayer.tsx +++ b/components/player/VideoPlayer.tsx @@ -77,7 +77,6 @@ export function VideoPlayer({ playUrl, videoId, currentEpisode, onBack }: VideoP // Auto-retry with proxy if not already using it if (!useProxy) { - console.log('Attempting to retry with proxy...'); setUseProxy(true); setShouldAutoPlay(true); // Force autoplay after proxy retry setVideoError(''); diff --git a/components/player/hooks/useHLSPreloader.ts b/components/player/hooks/useHLSPreloader.ts index 1b4785f..5d154ed 100644 --- a/components/player/hooks/useHLSPreloader.ts +++ b/components/player/hooks/useHLSPreloader.ts @@ -27,12 +27,11 @@ export function useHLSPreloader({ src, currentTime, videoRef, isLoading }: UseHL const fetchManifest = async () => { try { - console.log('[Preloader] Fetching manifest:', src); + // Fetch manifest const segments = await parseHLSManifest(src); segmentsRef.current = segments; setIsManifestLoaded(true); const totalDuration = segments[segments.length - 1]?.startTime + segments[segments.length - 1]?.duration || 0; - console.log(`[Preloader] Parsed ${segments.length} segments. Total duration: ${totalDuration.toFixed(2)}s`); } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); if (errorMessage.includes('503') || errorMessage.includes('Network unavailable')) { diff --git a/components/player/hooks/useHlsPlayer.ts b/components/player/hooks/useHlsPlayer.ts index d13c46d..32e69bc 100644 --- a/components/player/hooks/useHlsPlayer.ts +++ b/components/player/hooks/useHlsPlayer.ts @@ -42,7 +42,6 @@ export function useHlsPlayer({ // EXCEPT for Chrome on Desktop which reports canPlayType as '' (false). if (!isNativeHlsSupported) { - console.log('[HLS] Initializing hls.js'); hls = new Hls({ enableWorker: true, lowLatencyMode: true, @@ -53,7 +52,6 @@ export function useHlsPlayer({ hls.attachMedia(video); hls.on(Hls.Events.MANIFEST_PARSED, () => { - console.log('[HLS] Manifest parsed'); // Check for HEVC/H.265 codec (limited browser support) if (hls) { @@ -115,13 +113,11 @@ export function useHlsPlayer({ } }); } else { - console.log('[HLS] Using native HLS support'); // Native HLS support video.src = src; } } else if (isNativeHlsSupported) { // Fallback for environments where Hls.js is not supported but native is (e.g. iOS without MSE?) - console.log('[HLS] Using native HLS support (Hls.js not supported)'); video.src = src; } else { console.error('[HLS] HLS not supported in this browser'); diff --git a/lib/hooks/useHistoryDownloader.ts b/lib/hooks/useHistoryDownloader.ts index e8e6562..4545007 100644 --- a/lib/hooks/useHistoryDownloader.ts +++ b/lib/hooks/useHistoryDownloader.ts @@ -32,7 +32,7 @@ function useHistoryDownloader() { // Skip if not m3u8 if (!url.endsWith('.m3u8')) continue; - console.log(`[HistoryDownloader] Queueing background download for: ${item.title}`); + // Queue background download processedUrlsRef.current.add(url); try { @@ -46,9 +46,7 @@ function useHistoryDownloader() { signal: controller.signal, videoUrl: url, // Track metadata for this video onProgress: (current, total) => { - if (current % 50 === 0) { - console.log(`[HistoryDownloader] ${item.title}: ${current}/${total}`); - } + // console.log removed as per instruction } }); } catch (error) { diff --git a/lib/utils/cacheManager.ts b/lib/utils/cacheManager.ts index 0afc469..504942d 100644 --- a/lib/utils/cacheManager.ts +++ b/lib/utils/cacheManager.ts @@ -17,7 +17,6 @@ class CacheManager { try { const stored = localStorage.getItem(METADATA_STORE); if (stored) this.metadata = new Map(Object.entries(JSON.parse(stored))); - console.log('[CacheManager] Initialized with', this.metadata.size, 'entries'); } catch (error) { console.error('[CacheManager] Init failed:', error); } this.initialized = true; } @@ -38,7 +37,6 @@ class CacheManager { const meta = this.metadata.get(url); if (!meta) return false; if (Date.now() - meta.cachedAt > CACHE_TTL) { - console.log('[CacheManager] Cache expired:', url); return false; } meta.lastAccessed = Date.now(); @@ -61,7 +59,6 @@ class CacheManager { await this.initialize(); const stats = await this.getCacheStats(); if (stats.totalSizeMB > MAX_CACHE_SIZE_MB) { - console.log(`[CacheManager] Size ${stats.totalSizeMB.toFixed(2)}MB exceeds ${MAX_CACHE_SIZE_MB}MB`); await this.cleanupOldEntries(); } await this.cleanupExpiredEntries(); @@ -82,7 +79,6 @@ class CacheManager { } if (cleaned > 0) { this.save(); - console.log(`[CacheManager] Cleaned ${cleaned} expired entries`); } return cleaned; } @@ -101,7 +97,6 @@ class CacheManager { } if (removed > 0) { this.save(); - console.log(`[CacheManager] Removed ${removed} old entries`); } return removed; } @@ -120,7 +115,6 @@ class CacheManager { } if (cleared > 0) { this.save(); - console.log(`[CacheManager] Cleared ${cleared} entries for:`, videoUrl); } return cleared; } @@ -133,7 +127,6 @@ class CacheManager { const count = this.metadata.size; this.metadata.clear(); this.save(); - console.log(`[CacheManager] Cleared all ${count} entries`); return count; } } diff --git a/lib/utils/fetch-with-retry.ts b/lib/utils/fetch-with-retry.ts index f172420..dbeb5d1 100644 --- a/lib/utils/fetch-with-retry.ts +++ b/lib/utils/fetch-with-retry.ts @@ -61,7 +61,6 @@ export async function fetchWithRetry({ url, request, headers = {} }: FetchWithRe clearTimeout(timeoutId); if (response.ok) { - console.log(`✓ Proxy success on attempt ${attempt}: ${url.substring(0, 100)}...`); break; } diff --git a/lib/utils/hls-downloader.ts b/lib/utils/hls-downloader.ts index 7a8674a..3689570 100644 --- a/lib/utils/hls-downloader.ts +++ b/lib/utils/hls-downloader.ts @@ -60,12 +60,9 @@ export function preloadSegments({ return; } - // Only log on significant seeks or initial start + // Mark as initialized or handle seek if (!isInitializedRef.current) { - console.log(`[Preloader] Initial start at segment ${startIndex} (${currentTime.toFixed(2)}s)`); isInitializedRef.current = true; - } else if (!isSequential) { - console.log(`[Preloader] Seek detected. Current Time: ${currentTime.toFixed(2)}s. Starting from segment ${startIndex}.`); } lastStartIndexRef.current = startIndex; diff --git a/lib/utils/hlsManifestParser.ts b/lib/utils/hlsManifestParser.ts index a239b2e..94abe64 100644 --- a/lib/utils/hlsManifestParser.ts +++ b/lib/utils/hlsManifestParser.ts @@ -35,7 +35,6 @@ export async function parseHLSManifest(src: string): Promise