zt
06/24/2022, 2:11 AM@Composable
fun Player(
modifier: Modifier = Modifier,
player: Player,
) = DisposableEffect(
AndroidView(
modifier = Modifier
.aspectRatio(16f / 9f)
.then(modifier),
factory = { context ->
PlayerView(context).apply {
this.player = player
useController = false
useArtwork = true
resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT
}
}
)
) {
onDispose(player::release)
}
zt
06/24/2022, 2:19 AMvideoSurfaceView!!.alpha = 0.9f
in the apply block then the fade transition worksGrégory Lureau
06/24/2022, 7:59 AMmyanmarking
06/24/2022, 9:17 AMfengdai
06/24/2022, 1:31 PMsurface_type
to texture_view
?
app:surface_type="texture_view"