KhubaibKhan4 / MediaPlayer-KMP

MediaPlayer-KMP is a Kotlin Multiplatform (KMP) library that allows you to display and play YouTube videos across Android, iOS, Web, and Desktop platforms using JetBrains Compose Multiplatform. It provides a unified API for video playback that seamlessly integrates into Kotlin's multiplatform ecosystem.
GNU General Public License v2.0
116 stars 8 forks source link

(IOS)UIKitView onResize is Deprecated on compose 1.7.0 #46

Closed xiaoyvyv closed 4 weeks ago

xiaoyvyv commented 1 month ago

onResize is Deprecated on compose 1.7.0

UIKitView(
        factory = {
            val playerContainer = UIView()
            playerContainer.addSubview(avPlayerViewController.view)
            playerContainer
        },
        onResize = { view: UIView, rect: CValue<CGRect> ->
            CATransaction.begin()
            CATransaction.setValue(true, kCATransactionDisableActions)
            view.layer.setFrame(rect)
            playerLayer.setFrame(rect)
            avPlayerViewController.view.layer.frame = rect
            CATransaction.commit()
        },
        update = { view ->
            player?.play()
            avPlayerViewController.player?.play()
        },
        modifier = modifier
    )
KhubaibKhan4 commented 1 month ago

@xiaoyvyv Thank you for your suggestions, I'll defintely update it asap. If you do have any recommendation's please let me know.

KhubaibKhan4 commented 4 weeks ago

@xiaoyvyv Thank you for your suggestions. I just upgraded to Compose v1.7.0 and updated the UIKitView as well. Thank you again.