feat: hide video controls on playback start
Video controls are now hidden by default when playback begins. Users can tap to reveal them. Previously, controls were shown for 2 seconds before auto-hiding (TwoSecondController) or shown by default (VideoViewInner). https://claude.ai/code/session_01WpAqbodB5w8oDJpN6MLBs6
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ fun VideoViewInner(
|
|||||||
authorName: String? = null,
|
authorName: String? = null,
|
||||||
nostrUriCallback: String? = null,
|
nostrUriCallback: String? = null,
|
||||||
automaticallyStartPlayback: Boolean,
|
automaticallyStartPlayback: Boolean,
|
||||||
controllerVisible: MutableState<Boolean> = mutableStateOf(true),
|
controllerVisible: MutableState<Boolean> = mutableStateOf(false),
|
||||||
onZoom: (() -> Unit)? = null,
|
onZoom: (() -> Unit)? = null,
|
||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
) {
|
) {
|
||||||
|
|||||||
+1
-7
@@ -124,7 +124,6 @@ import okhttp3.coroutines.executeAsync
|
|||||||
import okio.sink
|
import okio.sink
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import kotlin.time.Duration.Companion.seconds
|
|
||||||
|
|
||||||
// Delay before cleaning up shared video temp files.
|
// Delay before cleaning up shared video temp files.
|
||||||
// Allows time for receiving app to copy the file after user confirms share.
|
// Allows time for receiving app to copy the file after user confirms share.
|
||||||
@@ -224,12 +223,7 @@ fun TwoSecondController(
|
|||||||
content: BaseMediaContent,
|
content: BaseMediaContent,
|
||||||
inner: @Composable (controllerVisible: MutableState<Boolean>) -> Unit,
|
inner: @Composable (controllerVisible: MutableState<Boolean>) -> Unit,
|
||||||
) {
|
) {
|
||||||
val controllerVisible = remember(content) { mutableStateOf(true) }
|
val controllerVisible = remember(content) { mutableStateOf(false) }
|
||||||
|
|
||||||
LaunchedEffect(content) {
|
|
||||||
delay(2.seconds)
|
|
||||||
controllerVisible.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
inner(controllerVisible)
|
inner(controllerVisible)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user