-
-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VisionOS Support for VisionOSVideoComponent #310
Comments
NativeGallery returns the picked video's path. How would you prefer it to behave with VisionOS? |
@yasirkula To clarify, is NativeGallery confirmed to work with VisionOS? I've been fighting it all day with no luck, but would love to find out that I had just been doing something incorrectly! :) |
I've heard from a couple of users that it doesn't work on VisionOS. I don't have a Vision Pro to test it myself but for the time being, we can say that it isn't supported. |
You can use an emulator to test |
I don't have access to a Mac workstation either and for this task, I'm relying on a fix from a volunteer (if anyone fixes the issue, please create a Pull Request). |
lol 🤣,good question. |
@yasirkula Sorry for taking so long to get back to this. I'm not very familiar with how your package worked (I only was looking for ways to get to the Gallery and stumbled here before I read that it wasn't supported), but I have a solution that prompts the gallery so that you can choose images/videos. It doesn't allow actually taking photos (VisionOS doesn't give you that permission to camera data) - but I could share that with you if it's something you think would be useful. |
@randalhucker It sounds very useful for VisionOS, so I'd very much like to see your solution 👑 |
@yasirkula I'll send everything in this thread when I get home tonight. |
I really need it. Can you share it with me |
Below is everything you need. All you need to do is call ImagePicker inside of a sheet or something similar: ImagePicker() I call it like this This does a few things... the 'selectionLimit' is how many 'items' you can pick from the gallery, and the filter is the type (i.e. photos, videos, etc.) There are many ways to get the info out, but for me I needed one photo, so I have a class - CurrentImage - that holds the id, original extension, and the image data. You can see how I'm assigning them below.
|
Can you share the full file, I am not an ios developer and do not know how to use this code |
@RandyHucker Thank you for sharing your code 🌷 I have little-to-none Swift experience but if I understand the key parts correctly, it works similar to NativeGallery. Perhaps VisionOS only works with Swift? How are you creating and displaying a new instance of ImagePicker struct? |
@yasirkula Yes, it does work very similarly. And I'm not sure if it's convertible to objective-c. I've been coding for the VPro only in Swift. And Swift makes it easy, it has |
Oh wait, I think my code doesn't present PHPickerViewController on VisionPro. @414726193 Could you remove the UnityNativeGallery/Plugins/NativeGallery/iOS/NativeGallery.mm Lines 594 to 619 in ae2ebf6
|
|
|
Can you attach the latest version of your code? |
NativeGallery.txt |
@yasirkula Not sure if you do something similar, but in Swift we have a 'plist' which is essentially a permissions file. I believe you might need to have the arbitrary loads enabled. Hopefully, that helps. I'm unfamiliar with Unity's errors. |
@RandyHucker Thank you. @414726193 Could you try adding it to your Info.plist? If that doesn't resolve the issue, could you put lots of NSLog statements in NativeGallery.mm (you can modify it inside Xcode for convenience) to pinpoint exactly which line crashes the app? If the stacktrace shows that line already, then that's great. I'll need to know which line does this. |
@yasirkula |
Hmm, my technical knowledge is at its limit right now. I'd recommend adding |
My current roundabout way is to pop up a web browser to upload a file, instead of just native file picker on visionOS |
That's smart and the interface you've created looks great IMO. May I ask how you've achieved this? |
It's kinda hacky
|
Also spent a day experimenting with the antique camera obscura as a skeuomorphic interface |
AI stack
|
During this time, I finally found a solution where unity could interact with SwiftUI and wake up the gallery by calling SwiftUI
swiftcode `
`
` |
@yosun Thanks again 🌷 This solution probably won't apply to most Unity users but hey, it works for you! I couldn't see AI models in action in the video though I'm sure we'll be seeing them soon. @414726193 That's a comprehensive Swift answer, thank you for sharing your findings! |
Please support VisionOS
https://docs.unity3d.com/Packages/[email protected]/manual/VideoComponent.html?q=video
The text was updated successfully, but these errors were encountered: