From 7f26ad508ebe61d2e875ee3b585639c95bf1b9b6 Mon Sep 17 00:00:00 2001
From: Hailey <me@haileyok.com>
Date: Tue, 3 Sep 2024 11:04:46 -0700
Subject: [Video] Toggle controls when entering fullscreen (#5113)

---
 .../com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx')

diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx
index fa59b9c99..189701ab0 100644
--- a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx
+++ b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx
@@ -26,6 +26,7 @@ export function VideoEmbedInnerNative({
   const {_} = useLingui()
   const {player} = useActiveVideoNative()
   const ref = useRef<VideoView>(null)
+  const [isFullscreen, setIsFullscreen] = useState(false)
 
   const enterFullscreen = useCallback(() => {
     ref.current?.enterFullscreen()
@@ -46,12 +47,13 @@ export function VideoEmbedInnerNative({
         player={player}
         style={[a.flex_1, a.rounded_sm]}
         contentFit="contain"
-        nativeControls={false}
+        nativeControls={isFullscreen}
         accessibilityIgnoresInvertColors
         onEnterFullscreen={() => {
           PlatformInfo.setAudioCategory(AudioCategory.Playback)
           PlatformInfo.setAudioActive(true)
           player.muted = false
+          setIsFullscreen(true)
         }}
         onExitFullscreen={() => {
           PlatformInfo.setAudioCategory(AudioCategory.Ambient)
@@ -60,6 +62,7 @@ export function VideoEmbedInnerNative({
           if (!player.playing) {
             player.play()
           }
+          setIsFullscreen(false)
         }}
         accessibilityLabel={
           embed.alt ? _(msg`Video: ${embed.alt}`) : _(msg`Video`)
-- 
cgit 1.4.1

