diff --git a/build-and-publish-app-release.sh b/build-and-publish-app-release.sh old mode 100644 new mode 100755 diff --git a/src/components/metadata/HeroSection.tsx b/src/components/metadata/HeroSection.tsx index 8a0a811e..eb8c9c53 100644 --- a/src/components/metadata/HeroSection.tsx +++ b/src/components/metadata/HeroSection.tsx @@ -859,7 +859,7 @@ const HeroSection: React.FC = memo(({ }, [trailerOpacity, thumbnailOpacity]); // Handle trailer end - seamless transition back to thumbnail - const handleTrailerEnd = useCallback(() => { + const handleTrailerEnd = useCallback(async () => { logger.info('HeroSection', 'Trailer ended - transitioning back to thumbnail'); setTrailerPlaying(false); @@ -867,6 +867,16 @@ const HeroSection: React.FC = memo(({ setTrailerReady(false); setTrailerPreloaded(false); + // If trailer is in fullscreen, dismiss it first + try { + if (trailerVideoRef.current) { + await trailerVideoRef.current.dismissFullscreenPlayer(); + logger.info('HeroSection', 'Dismissed fullscreen player after trailer ended'); + } + } catch (error) { + logger.warn('HeroSection', 'Error dismissing fullscreen player:', error); + } + // Smooth fade transition: trailer out, thumbnail in trailerOpacity.value = withTiming(0, { duration: 500 }); thumbnailOpacity.value = withTiming(1, { duration: 500 }); diff --git a/src/components/video/TrailerPlayer.tsx b/src/components/video/TrailerPlayer.tsx index 0fe7240a..5ce62332 100644 --- a/src/components/video/TrailerPlayer.tsx +++ b/src/components/video/TrailerPlayer.tsx @@ -288,6 +288,11 @@ const TrailerPlayer = React.forwardRef(({ if (videoRef.current && isComponentMounted) { return videoRef.current.presentFullscreenPlayer(); } + }, + dismissFullscreenPlayer: () => { + if (videoRef.current && isComponentMounted) { + return videoRef.current.dismissFullscreenPlayer(); + } } }));