compose-video
compose-video copied to clipboard
Dialog displays an error after attachBaseContext()
After override the context configuration to prevent font scaling and density scaling, the full screen dialog displays an error.
override fun attachBaseContext(newBase: Context) {
val resources = newBase.resources
val overrideConfiguration = Configuration(resources.configuration)
.apply {
fontScale = 1.0f
densityDpi = resources.displayMetrics.xdpi.toInt()
}
super.attachBaseContext(
newBase.createConfigurationContext(overrideConfiguration)
)
}
After set defaultPlayerView background to GRAY.
DisposableEffect(
AndroidView(
modifier = modifier,
factory = {
defaultPlayerView.apply {
useController = usePlayerController
resizeMode = surfaceResizeMode.toPlayerViewResizeMode()
setBackgroundColor(Color.GRAY)
}
},
),
) {