IanPhilips / UnityOculusAndroidVRBrowser

3D browser based on GeckoView and Oculus SDK for Unity projects built on Android (Oculus Go/Quest, maybe GearVR)
MIT License
225 stars 63 forks source link

How to implement multiple windows #25

Closed sienori closed 3 years ago

sienori commented 3 years ago

Hi, thank you for the great plugin! I would like to implement multiple windows using this plugin. Do you have any tips on how to implement it?

I think it is possible to run multiple sessions by duplicating OVRSurfaceGeckoView. But I don't know how to render it in OVROverlay...

IanPhilips commented 3 years ago

Hey, nothing comes to mind that would block this. You just need an OVROverlay on each browserview instance, and Oculus allows something like 15 overlays per scene. What have you tried so far?

sienori commented 3 years ago

Do you mean duplicate the object with Browser View and OVR Overlay attached? I tried that, but I get an error when there are multiple Browser View.

Error AndroidRuntime FATAL EXCEPTION: main
Error AndroidRuntime Process: com.ianphilips.UnityAndroidVRBrowser, PID: 24155
Error AndroidRuntime java.lang.IllegalStateException: Only one GeckoRuntime instance is allowed
Error AndroidRuntime    at org.mozilla.geckoview.GeckoRuntime. < init > (GeckoRuntime.java: 183)
Error AndroidRuntime    at org.mozilla.geckoview.GeckoRuntime.create(GeckoRuntime.java: 579)
Error AndroidRuntime    at com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin.InitNewRuntime(GeckoViewPLugin.java: 488)
Error AndroidRuntime    at com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin.initViews(GeckoViewPLugin.java: 475)
Error AndroidRuntime    at com.eyeflite.ian.geckoviewplugin.GeckoViewPLugin.onCreateView(GeckoViewPLugin.java: 856)
Error AndroidRuntime    at android.app.Fragment.performCreateView(Fragment.java: 2534)
Error AndroidRuntime    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java: 1303)
Error AndroidRuntime    at android.app.FragmentManagerImpl.addAddedFragments(FragmentManager.java: 2431)
Error AndroidRuntime    at android.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java: 2210)
Error AndroidRuntime    at android.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java: 2166)
Error AndroidRuntime    at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java: 2067)
Error AndroidRuntime    at android.app.FragmentManagerImpl$1.run(FragmentManager.java: 742)
Error AndroidRuntime    at android.os.Handler.handleCallback(Handler.java: 883)
Error AndroidRuntime    at android.os.Handler.dispatchMessage(Handler.java: 100)
Error AndroidRuntime    at android.os.Looper.loop(Looper.java: 214)
Error AndroidRuntime    at android.app.ActivityThread.main(ActivityThread.java: 7387)
Error AndroidRuntime    at java.lang.reflect.Method.invoke(Native Method)
Error AndroidRuntime    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java: 492)
Error AndroidRuntime    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 930)
sienori commented 3 years ago

I solved this issue and sent a PR! #27

IanPhilips commented 3 years ago

Thanks for the PR! I just merged it and also just updated the geckoview library to 84, built it, AND copied it to the plugins folder unlike last time (which you fixed) 👀