Hi everyone, I'm currently working on implementing...
# compose-ios
v
Hi everyone, I'm currently working on implementing Picture-in-Picture (PiP) functionality for a video player in a Kotlin Multiplatform (KMP) project. Specifically, I'm looking to: • Enable PiP when the user presses the home button • Support automatic PiP activation • Maintain compatibility with iOS/Android through KMP If anyone has experience with this or can recommend any helpful articles, tutorials, or blog posts on implementing PiP in KMP, I would greatly appreciate your suggestions. for IOS I am looking android i have created
g
I think for both Android and iOS you just need to wrap system APIs, no other options
if you need also desktop, you have implement it yourself, but for Android/iOS, until someone wrote a library specifically to abstract it, just wrap system APIs, call it from common code
v
I only need Picture-in-Picture support for Android and iOS. I've already implemented it on Android, and it's working fine. However, I’m struggling with the iOS implementation — there’s very limited documentation or blogs available. I tried following Swift-based approaches, but PiP mode is still not working. My code follows a Reels-like video playback behavior.
g
yes, they way more limited on iOS, only specific use cases are supported
so I would suggest to first make it work, it's not really about compose or Kotlin, you need working PiP implementation on iOS first
You can try just with some iOS sample app
I believe built-in PiP on iOS works only for AVKit
v
I checked on github pip related no code is there but i will do some poc figure out
Okay thanks for reply will try with some poc app first
g
I googled and it shows me this project on GH https://github.com/halilozel1903/PictureinPictureApp
it also have links to other materials
v
I have ios friend yesterday he created pip within 5 min and it's working fine in ios but when same pattern i tried in kmp pip is not triggeing
g
so probably there are differences, I would suggest just review it
v
Sure thank you 🙂
g
if you use the same APIs, it should work, I don't see why it wouldn't
Good luck
🙌 1
a
@Vishal kumar singhvi Able to get it working? currently facing the same challenge