From 0f080219b29a5627b204c7435de017bf9226cc13 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 1 May 2023 18:54:06 -0400 Subject: [PATCH] Starts on mute --- .../main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt | 3 +++ .../java/com/vitorpamplona/amethyst/ui/components/VideoView.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt index e60c431fc..808caf46f 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/MainActivity.kt @@ -22,6 +22,7 @@ import com.vitorpamplona.amethyst.ServiceManager import com.vitorpamplona.amethyst.VideoCache import com.vitorpamplona.amethyst.service.nip19.Nip19 import com.vitorpamplona.amethyst.service.relays.Client +import com.vitorpamplona.amethyst.ui.components.muted import com.vitorpamplona.amethyst.ui.navigation.Route import com.vitorpamplona.amethyst.ui.note.Nip47 import com.vitorpamplona.amethyst.ui.screen.AccountScreen @@ -92,6 +93,8 @@ class MainActivity : FragmentActivity() { @OptIn(DelicateCoroutinesApi::class) override fun onResume() { super.onResume() + // starts muted every time + muted.value = true // Only starts after login GlobalScope.launch(Dispatchers.IO) { 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 73ec63465..829fe4fb9 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 @@ -58,7 +58,7 @@ import com.google.android.exoplayer2.util.Util import com.vitorpamplona.amethyst.VideoCache import java.io.File -private var muted = mutableStateOf(true) +public var muted = mutableStateOf(true) @Composable fun VideoView(localFile: File, description: String? = null, onDialog: ((Boolean) -> Unit)? = null) {