I am currently trying to find a way for having a web browser in a VR application. Basically the goal is to open a page like https://stackoverflow.com in a panel and to have it scrollable through the oculus go controller.
I already did some research on plugins for achieving this like this but none of them seems to work on the oculus go.
This is a repo I made in the hopes we can implement a nice in-game browser. It's a bit buggy/slow but it works (most of the time).
It uses a Java plugin that renders an Android
WebView
to aBitmap
by overriding the view'sDraw
method, converts that to a png and passes it to a unityRawImage
. There is plenty of work to do so feel free to improve it!How to use it:
At the repo you can find the plugin (
unitylibrary-debug.aar
) you need to import to Assets/Plugins/Android/ andBrowserView.cs
andUnityThread.cs
which you can use to convert an AndroidWebView
to a texture that Unity'sRawImage
can display. FillBrowserView.cs
's public fields appropriately. Make sure your API level is set to 25 in Unity's player settings.Code samples
Here's overriding the
WebView
'sDraw
method to create the bitmap and PNG, and init-ing the variables you need:Then we pass the png to a unity
RawImage
. Here's the Unity receiving side: