From 1fe872c45e11974a8e66e4c3c178300eff68d7ea Mon Sep 17 00:00:00 2001 From: Kevin Rocard Date: Wed, 6 Dec 2023 16:47:16 +0100 Subject: [PATCH] refactor: align handling of default values PRN-92 --- src/components/PlayerView/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/PlayerView/index.tsx b/src/components/PlayerView/index.tsx index 86155c25..d48ae4ed 100644 --- a/src/components/PlayerView/index.tsx +++ b/src/components/PlayerView/index.tsx @@ -48,9 +48,9 @@ export function PlayerView({ config, fullscreenHandler, customMessageHandler, - isFullscreenRequested = false, + isFullscreenRequested, scalingMode, - isPictureInPictureRequested = false, + isPictureInPictureRequested, ...props }: PlayerViewProps) { // Workaround React Native UIManager commands not sent until UI refresh @@ -125,7 +125,7 @@ export function PlayerView({ useEffect(() => { const node = findNodeHandle(nativeView.current); - if (node) { + if (node && isFullscreenRequested) { dispatch('setFullscreen', node, isFullscreenRequested); } }, [isFullscreenRequested, nativeView]); @@ -139,7 +139,7 @@ export function PlayerView({ useEffect(() => { const node = findNodeHandle(nativeView.current); - if (node) { + if (node && isPictureInPictureRequested) { dispatch('setPictureInPicture', node, isPictureInPictureRequested); } }, [isPictureInPictureRequested, nativeView]);