How to make a ExoPlayer fill a the parent Box wit...
# compose
m
How to make a ExoPlayer fill a the parent Box with AndroidView? This is what I tried:
Copy code
AndroidView(
    modifier = Modifier.fillMaxSize(),
    factory = { context ->
        PlayerView(context).also { playerView ->
            // ...

            FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT
            )
        }
    }
)
using
playerView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM
looks like the way to go, no need to call FrameLayout
f
It looks like you didn't actually set the layout params. Here is how we are using a full-screen ExoPlayer inside a Compose app:
Copy code
AndroidView(                                                        
    modifier = Modifier.fillMaxSize(),                              
    factory = {                                                     
        StyledPlayerView(it).apply {                                
            this.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT
            layoutParams = FrameLayout.LayoutParams(                
                ViewGroup.LayoutParams.MATCH_PARENT,                
                ViewGroup.LayoutParams.MATCH_PARENT                 
            )                                                       
        }                                                           
    }                                                               
)
m
yep, it works too! It's necessary to change
also
to
apply