From 080346716b736df5a0434d7fd1a621b0797290ed Mon Sep 17 00:00:00 2001 From: Kayos 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 Cobb 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 04d79017d..6ae432336 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 02479cf99..e7b763148 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 },