From a241de97f6aa553f36879adf372680e77374c83e Mon Sep 17 00:00:00 2001 From: tapframe Date: Mon, 15 Sep 2025 01:20:11 +0530 Subject: [PATCH] push --- build-and-publish-app-release.sh | 4 ++-- src/components/metadata/HeroSection.tsx | 21 +++++++++++++++++++++ src/components/video/TrailerPlayer.tsx | 6 ++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/build-and-publish-app-release.sh b/build-and-publish-app-release.sh index e82cb29e4..499ffd85b 100644 --- a/build-and-publish-app-release.sh +++ b/build-and-publish-app-release.sh @@ -116,7 +116,7 @@ echo "📊 File size: $(du -h ${timestamp}.zip | cut -f1)" # Check server health before upload echo "🔍 Checking server status..." -if ! curl --max-time 10 --connect-timeout 5 -s -o /dev/null "$serverHost/api/manifest"; then +if ! curl --http1.1 --max-time 10 --connect-timeout 5 -s -o /dev/null "$serverHost/api/manifest"; then echo "⚠️ Warning: Server may be slow or unresponsive" echo "💡 Proceeding with upload anyway..." else @@ -131,7 +131,7 @@ retry_count=0 while [ $retry_count -lt $max_retries ]; do echo "🔄 Upload attempt $((retry_count + 1))/$max_retries..." - response=$(curl --max-time 300 --connect-timeout 30 -X POST $serverHost/api/upload \ + response=$(curl --http1.1 --max-time 300 --connect-timeout 30 -X POST $serverHost/api/upload \ -F "file=@${timestamp}.zip" \ -F "runtimeVersion=$runtimeVersion" \ -F "commitHash=$commitHash" \ diff --git a/src/components/metadata/HeroSection.tsx b/src/components/metadata/HeroSection.tsx index 41fa4ee26..38974b1b0 100644 --- a/src/components/metadata/HeroSection.tsx +++ b/src/components/metadata/HeroSection.tsx @@ -850,6 +850,26 @@ const HeroSection: React.FC = memo(({ trailerOpacity.value = withTiming(0, { duration: 300 }); thumbnailOpacity.value = withTiming(1, { duration: 300 }); }, [trailerOpacity, thumbnailOpacity]); + + // Handle trailer end - seamless transition back to thumbnail + const handleTrailerEnd = useCallback(() => { + logger.info('HeroSection', 'Trailer ended - transitioning back to thumbnail'); + setTrailerPlaying(false); + + // Reset trailer state to prevent auto-restart + setTrailerReady(false); + setTrailerPreloaded(false); + + // Smooth fade transition: trailer out, thumbnail in + trailerOpacity.value = withTiming(0, { duration: 500 }); + thumbnailOpacity.value = withTiming(1, { duration: 500 }); + + // Show UI elements again + actionButtonsOpacity.value = withTiming(1, { duration: 500 }); + genreOpacity.value = withTiming(1, { duration: 500 }); + titleCardTranslateY.value = withTiming(0, { duration: 500 }); + watchProgressOpacity.value = withTiming(1, { duration: 500 }); + }, [trailerOpacity, thumbnailOpacity, actionButtonsOpacity, genreOpacity, titleCardTranslateY, watchProgressOpacity, setTrailerPlaying]); // Memoized image source const imageSource = useMemo(() => @@ -1320,6 +1340,7 @@ const HeroSection: React.FC = memo(({ onFullscreenToggle={handleFullscreenToggle} onLoad={handleTrailerReady} onError={handleTrailerError} + onEnd={handleTrailerEnd} onPlaybackStatusUpdate={(status) => { if (status.isLoaded && !trailerReady) { handleTrailerReady(); diff --git a/src/components/video/TrailerPlayer.tsx b/src/components/video/TrailerPlayer.tsx index 59714f724..0fe7240ae 100644 --- a/src/components/video/TrailerPlayer.tsx +++ b/src/components/video/TrailerPlayer.tsx @@ -34,6 +34,7 @@ interface TrailerPlayerProps { onError?: (error: string) => void; onProgress?: (data: OnProgressData) => void; onPlaybackStatusUpdate?: (status: { isLoaded: boolean; didJustFinish: boolean }) => void; + onEnd?: () => void; style?: any; hideLoadingSpinner?: boolean; onFullscreenToggle?: () => void; @@ -49,6 +50,7 @@ const TrailerPlayer = React.forwardRef(({ onError, onProgress, onPlaybackStatusUpdate, + onEnd, style, hideLoadingSpinner = false, onFullscreenToggle, @@ -351,6 +353,10 @@ const TrailerPlayer = React.forwardRef(({ // Stop playback when trailer finishes to avoid continuous GPU/decoder use if (isComponentMounted) { setIsPlaying(false); + // Notify parent component that trailer has ended + if (onEnd) { + onEnd(); + } } }} onFullscreenPlayerWillPresent={() => setIsFullscreen(true)}