I had been using code like: ```CATransaction.begin...
# ios
a
I had been using code like:
Copy code
CATransaction.begin()
CATransaction.setValue(true, kCATransactionDisableActions)

view.layer.setFrame(rect)
avPlayerViewController.view.layer.frame = rect

CATransaction.commit()
to set the size of the player but now that doesn't appear to work
p
Hey. Sorry for responding to a message from a month ago, but did you figure this out? I have the same problem myself.
I found a solution now anyway:
Copy code
UIKitView(
    modifier = modifier,
    factory = {
        avPlayerViewController.player = player
        avPlayerViewController.videoGravity = AVLayerVideoGravityResizeAspectFill
        avPlayerViewController.showsPlaybackControls = false

        val playerContainer = UIView()
        playerContainer.apply {
            addSubview(avPlayerViewController.view)
        }

        playerContainer
    },
    update = { view ->
        avPlayerViewController.view.layer.frame = view.bounds
    },
)
k
Nice Per 🌟
p
I stumbled into this as well yesterday. Fix was something like this: https://github.com/JetBrains/compose-multiplatform/pull/5166
👍 2