Adjust volume based on changing global mute variable.
This commit is contained in:
@@ -100,6 +100,10 @@ fun VideoView(videoUri: Uri, description: String? = null, onDialog: ((Boolean) -
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(key1 = muted.value) {
|
||||
exoPlayer.volume = if (muted.value) 0f else 1f
|
||||
}
|
||||
|
||||
DisposableEffect(
|
||||
Box() {
|
||||
AndroidView(
|
||||
@@ -136,7 +140,6 @@ fun VideoView(videoUri: Uri, description: String? = null, onDialog: ((Boolean) -
|
||||
|
||||
MuteButton(muted, Modifier) {
|
||||
muted.value = !muted.value
|
||||
exoPlayer.volume = if (muted.value) 0f else 1f
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user