From c664397b11d14e547a4cdff5c47e558bd29b188a Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Tue, 30 May 2023 13:58:21 -0400 Subject: [PATCH] Starts video with the audio on/off based on global mute variable --- .../java/com/vitorpamplona/amethyst/ui/components/VideoView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/VideoView.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/VideoView.kt index 78a2dc6ba..c72fdeef1 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/VideoView.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/VideoView.kt @@ -138,7 +138,7 @@ fun VideoView(videoUri: Uri, description: String? = null, thumb: Drawable? = nul ExoPlayer.Builder(context).build().apply { repeatMode = Player.REPEAT_MODE_ALL videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT - volume = 0f + volume = if (mutedInstance.value) 0f else 1f if (videoUri.scheme?.startsWith("file") == true) { setMediaItem(media) } else {