This commit is contained in:
tapframe 2025-09-15 01:20:11 +05:30
parent 3ce0db9d2a
commit a241de97f6
3 changed files with 29 additions and 2 deletions

View file

@ -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" \

View file

@ -850,6 +850,26 @@ const HeroSection: React.FC<HeroSectionProps> = 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<HeroSectionProps> = memo(({
onFullscreenToggle={handleFullscreenToggle}
onLoad={handleTrailerReady}
onError={handleTrailerError}
onEnd={handleTrailerEnd}
onPlaybackStatusUpdate={(status) => {
if (status.isLoaded && !trailerReady) {
handleTrailerReady();

View file

@ -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<any, TrailerPlayerProps>(({
onError,
onProgress,
onPlaybackStatusUpdate,
onEnd,
style,
hideLoadingSpinner = false,
onFullscreenToggle,
@ -351,6 +353,10 @@ const TrailerPlayer = React.forwardRef<any, TrailerPlayerProps>(({
// 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)}