mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
trailerplayer stuck after finishing fix
This commit is contained in:
parent
03bded3775
commit
fb8b65e61b
3 changed files with 16 additions and 1 deletions
0
build-and-publish-app-release.sh
Normal file → Executable file
0
build-and-publish-app-release.sh
Normal file → Executable file
|
|
@ -859,7 +859,7 @@ const HeroSection: React.FC<HeroSectionProps> = 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<HeroSectionProps> = 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 });
|
||||
|
|
|
|||
|
|
@ -288,6 +288,11 @@ const TrailerPlayer = React.forwardRef<any, TrailerPlayerProps>(({
|
|||
if (videoRef.current && isComponentMounted) {
|
||||
return videoRef.current.presentFullscreenPlayer();
|
||||
}
|
||||
},
|
||||
dismissFullscreenPlayer: () => {
|
||||
if (videoRef.current && isComponentMounted) {
|
||||
return videoRef.current.dismissFullscreenPlayer();
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue