mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-29 19:13:04 +02:00
Consistent naming and behavior for the video player controls.
This commit is contained in:
@@ -350,7 +350,7 @@ fun VideoViewInner(
|
|||||||
defaultToStart: Boolean = false,
|
defaultToStart: Boolean = false,
|
||||||
title: String? = null,
|
title: String? = null,
|
||||||
thumb: VideoThumb? = null,
|
thumb: VideoThumb? = null,
|
||||||
showControls: Boolean = false,
|
showControls: Boolean = true,
|
||||||
isFiniteHeight: Boolean,
|
isFiniteHeight: Boolean,
|
||||||
borderModifier: Modifier,
|
borderModifier: Modifier,
|
||||||
waveform: ImmutableList<Int>? = null,
|
waveform: ImmutableList<Int>? = null,
|
||||||
@@ -375,7 +375,7 @@ fun VideoViewInner(
|
|||||||
mimeType = mimeType,
|
mimeType = mimeType,
|
||||||
controller = controller,
|
controller = controller,
|
||||||
thumbData = thumb,
|
thumbData = thumb,
|
||||||
hideControls = showControls,
|
showControls = showControls,
|
||||||
isFiniteHeight = isFiniteHeight,
|
isFiniteHeight = isFiniteHeight,
|
||||||
nostrUriCallback = nostrUriCallback,
|
nostrUriCallback = nostrUriCallback,
|
||||||
waveform = waveform,
|
waveform = waveform,
|
||||||
@@ -723,7 +723,7 @@ private fun RenderVideoPlayer(
|
|||||||
mimeType: String?,
|
mimeType: String?,
|
||||||
controller: MediaController,
|
controller: MediaController,
|
||||||
thumbData: VideoThumb?,
|
thumbData: VideoThumb?,
|
||||||
hideControls: Boolean = false,
|
showControls: Boolean = true,
|
||||||
isFiniteHeight: Boolean,
|
isFiniteHeight: Boolean,
|
||||||
nostrUriCallback: String?,
|
nostrUriCallback: String?,
|
||||||
waveform: ImmutableList<Int>? = null,
|
waveform: ImmutableList<Int>? = null,
|
||||||
@@ -754,7 +754,7 @@ private fun RenderVideoPlayer(
|
|||||||
setBackgroundColor(Color.Transparent.toArgb())
|
setBackgroundColor(Color.Transparent.toArgb())
|
||||||
setShutterBackgroundColor(Color.Transparent.toArgb())
|
setShutterBackgroundColor(Color.Transparent.toArgb())
|
||||||
controllerAutoShow = false
|
controllerAutoShow = false
|
||||||
useController = !hideControls
|
useController = showControls
|
||||||
thumbData?.thumb?.let { defaultArtwork = it }
|
thumbData?.thumb?.let { defaultArtwork = it }
|
||||||
hideController()
|
hideController()
|
||||||
resizeMode =
|
resizeMode =
|
||||||
@@ -763,7 +763,7 @@ private fun RenderVideoPlayer(
|
|||||||
} else {
|
} else {
|
||||||
AspectRatioFrameLayout.RESIZE_MODE_FIXED_WIDTH
|
AspectRatioFrameLayout.RESIZE_MODE_FIXED_WIDTH
|
||||||
}
|
}
|
||||||
if (!hideControls) {
|
if (showControls) {
|
||||||
onDialog?.let { innerOnDialog ->
|
onDialog?.let { innerOnDialog ->
|
||||||
setFullscreenButtonClickListener {
|
setFullscreenButtonClickListener {
|
||||||
controller.pause()
|
controller.pause()
|
||||||
@@ -783,7 +783,7 @@ private fun RenderVideoPlayer(
|
|||||||
|
|
||||||
waveform?.let { Waveform(it, controller, remember { Modifier.align(Alignment.Center) }) }
|
waveform?.let { Waveform(it, controller, remember { Modifier.align(Alignment.Center) }) }
|
||||||
|
|
||||||
if (!hideControls) {
|
if (showControls) {
|
||||||
val startingMuteState = remember(controller) { controller.volume < 0.001 }
|
val startingMuteState = remember(controller) { controller.volume < 0.001 }
|
||||||
|
|
||||||
MuteButton(
|
MuteButton(
|
||||||
|
Reference in New Issue
Block a user