Hey guys, I have Video player inside LazyColumn. It is measured before the content is loaded (and the item knows it’s actual aspect ratio). How can I set initial aspect ratio and change it after the item was loaded?
z
Zach Klippenstein (he/him) [MOD]
02/15/2024, 6:36 PM
Something like
Copy code
var aspectRatio by remember { mutableFloatStateOf(initial) }
…
Modifier.aspectRatio(aspectRatio)
…
onLoaded = { aspectRatio = video.aspectRatio }
e
electrolobzik
02/15/2024, 6:37 PM
Thank you Zach! It’s easier than I imagined initially 😄