fixup vc=53: keep screen on while fullscreen + inline player attached
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.
This commit is contained in:
parent
e26a3eca19
commit
080346716b
2 changed files with 13 additions and 0 deletions
|
|
@ -805,6 +805,11 @@ private fun InlinePlayer(
|
||||||
// fullscreen transition doesn't flash
|
// fullscreen transition doesn't flash
|
||||||
// black between detach + reattach.
|
// black between detach + reattach.
|
||||||
setKeepContentOnPlayerReset(true)
|
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 },
|
update = { it.player = controller },
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,14 @@ fun PlayerScreen(
|
||||||
// over the surface.
|
// over the surface.
|
||||||
controllerHideOnTouch = true
|
controllerHideOnTouch = true
|
||||||
setKeepContentOnPlayerReset(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 },
|
update = { it.player = controller },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue