Starts video with the audio on/off based on global mute variable

This commit is contained in:
Vitor Pamplona
2023-05-30 13:58:21 -04:00
parent bc1b71e9bf
commit c664397b11

View File

@@ -138,7 +138,7 @@ fun VideoView(videoUri: Uri, description: String? = null, thumb: Drawable? = nul
ExoPlayer.Builder(context).build().apply { ExoPlayer.Builder(context).build().apply {
repeatMode = Player.REPEAT_MODE_ALL repeatMode = Player.REPEAT_MODE_ALL
videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT
volume = 0f volume = if (mutedInstance.value) 0f else 1f
if (videoUri.scheme?.startsWith("file") == true) { if (videoUri.scheme?.startsWith("file") == true) {
setMediaItem(media) setMediaItem(media)
} else { } else {