From 5a95d63b00dbff610251b22626d99feb0dc38c26 Mon Sep 17 00:00:00 2001 From: Sulkta Date: Tue, 26 May 2026 09:09:07 -0700 Subject: [PATCH] fixup vc=53: keep screen on while fullscreen + inline player attached MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a tester hit screen-timeout-while-watching mid-build. View-level keepScreenOn=true on both PlayerViews — propagates to the window while the view is attached, releases the wake-lock automatically when the user backs out. Same pattern Media3 recommends for video apps. --- .../com/sulkta/straw/feature/detail/VideoDetailScreen.kt | 5 +++++ .../com/sulkta/straw/feature/player/PlayerScreen.kt | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailScreen.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailScreen.kt index 649600abe..ac12f7227 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailScreen.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/detail/VideoDetailScreen.kt @@ -805,6 +805,11 @@ private fun InlinePlayer( // fullscreen transition doesn't flash // black between detach + reattach. setKeepContentOnPlayerReset(true) + // Don't let the device timeout while the + // inline player is on-screen with the + // user reading the description. Detaches + // automatically when this view goes away. + keepScreenOn = true } }, update = { it.player = controller }, diff --git a/strawApp/src/main/kotlin/com/sulkta/straw/feature/player/PlayerScreen.kt b/strawApp/src/main/kotlin/com/sulkta/straw/feature/player/PlayerScreen.kt index 803f46415..91e259b3c 100644 --- a/strawApp/src/main/kotlin/com/sulkta/straw/feature/player/PlayerScreen.kt +++ b/strawApp/src/main/kotlin/com/sulkta/straw/feature/player/PlayerScreen.kt @@ -186,6 +186,14 @@ fun PlayerScreen( // over the surface. controllerHideOnTouch = true setKeepContentOnPlayerReset(true) + // Don't let the device timeout/lock while + // a fullscreen video is on-screen. View- + // level flag — propagates to the window + // while attached, clears on detach so + // backing out of fullscreen releases the + // wake-lock automatically. Mirror on the + // inline PlayerView for consistency. + keepScreenOn = true } }, update = { it.player = controller },