diff --git a/src/components/home/HeroCarousel.tsx b/src/components/home/HeroCarousel.tsx index 45aeb01..e3a5dbe 100644 --- a/src/components/home/HeroCarousel.tsx +++ b/src/components/home/HeroCarousel.tsx @@ -253,7 +253,7 @@ const HeroCarousel: React.FC = ({ items, loading = false }) = if (!hasData) return null; return ( - + {/* Removed preload images for performance - let FastImage cache handle it naturally */} {settings.enableHomeHeroBackground && data[activeIndex] && ( diff --git a/src/components/metadata/HeroSection.tsx b/src/components/metadata/HeroSection.tsx index bcd7084..defb394 100644 --- a/src/components/metadata/HeroSection.tsx +++ b/src/components/metadata/HeroSection.tsx @@ -1157,12 +1157,28 @@ const HeroSection: React.FC = memo(({ // Auto-start trailer when ready on initial entry if enabled useEffect(() => { if (trailerReady && settings?.showTrailers && isFocused && !globalTrailerPlaying && !startedOnReadyRef.current) { - startedOnReadyRef.current = true; - logger.info('HeroSection', 'Trailer ready - auto-starting playback'); - setTrailerPlaying(true); - isPlayingSV.value = 1; + // Check scroll position - only auto-start if user hasn't scrolled past the hero section + try { + const y = (scrollY as any).value || 0; + const pauseThreshold = heroHeight.value * 0.7; + + if (y < pauseThreshold) { + startedOnReadyRef.current = true; + logger.info('HeroSection', 'Trailer ready - auto-starting playback'); + setTrailerPlaying(true); + isPlayingSV.value = 1; + } else { + logger.info('HeroSection', 'Trailer ready but user scrolled past - not auto-starting'); + // Mark as started to prevent retry + startedOnReadyRef.current = true; + } + } catch (_e) { + // Fallback if scroll position unavailable - don't auto-start to be safe + logger.info('HeroSection', 'Trailer ready but scroll position unavailable - not auto-starting'); + startedOnReadyRef.current = true; + } } - }, [trailerReady, settings?.showTrailers, isFocused, globalTrailerPlaying, setTrailerPlaying]); + }, [trailerReady, settings?.showTrailers, isFocused, globalTrailerPlaying, setTrailerPlaying, scrollY, heroHeight]); // Handle fullscreen toggle const handleFullscreenToggle = useCallback(async () => { diff --git a/src/components/player/AndroidVideoPlayer.tsx b/src/components/player/AndroidVideoPlayer.tsx index 6a190a2..6b2dbdf 100644 --- a/src/components/player/AndroidVideoPlayer.tsx +++ b/src/components/player/AndroidVideoPlayer.tsx @@ -3323,6 +3323,7 @@ const AndroidVideoPlayer: React.FC = () => { ref={vlcPlayerRef} source={processedStreamUrl} volume={volume} + playbackSpeed={playbackSpeed} zoomScale={zoomScale} resizeMode={resizeMode} onLoad={(data) => { diff --git a/src/components/player/VlcVideoPlayer.tsx b/src/components/player/VlcVideoPlayer.tsx index 2202bfd..75a7dba 100644 --- a/src/components/player/VlcVideoPlayer.tsx +++ b/src/components/player/VlcVideoPlayer.tsx @@ -16,6 +16,7 @@ try { interface VlcVideoPlayerProps { source: string; volume: number; + playbackSpeed: number; zoomScale: number; resizeMode: 'contain' | 'cover' | 'none'; onLoad: (data: any) => void; @@ -46,6 +47,7 @@ export interface VlcPlayerRef { const VlcVideoPlayer = forwardRef(({ source, volume, + playbackSpeed, zoomScale, resizeMode, onLoad, @@ -342,7 +344,7 @@ const VlcVideoPlayer = forwardRef(({ volume={Math.round(Math.max(0, Math.min(1, volume)) * 100)} mute={false} repeat={false} - rate={1} + rate={playbackSpeed} autoplay={false} onFirstPlay={handleFirstPlay} onPositionChanged={handlePositionChanged} diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index c868cd7..748c8cf 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -631,20 +631,18 @@ const HomeScreen = () => { const heroStyleToUse = isTablet ? 'legacy' : settings.heroStyle; return heroStyleToUse === 'carousel' ? ( ) : ( ); - }, [isTablet, settings.heroStyle, showHeroSection, featuredContentSource, featuredLoading]); + }, [isTablet, settings.heroStyle, showHeroSection, featuredContentSource, allFeaturedContent, featuredContent, isSaved, handleSaveToLibrary, featuredLoading]); const memoizedThisWeekSection = useMemo(() => , []); const memoizedContinueWatchingSection = useMemo(() => , []);