Pitch
This is a working VR Webview Texture for Android (Unity asset).
It has been tested and works well with both Google Cardboard SDK and Google Daydream SDK.
It can also be used on non VR project as a classic Webview Texture (Android only)!
Limitations
It has some limitations (but I’m working on it)
- You can only have one VR Webview on your scene
- It works only for Android (no preview available on the Unity Editor) not working on iOS,
- The Webview itself is not hardware accelerated — read this it is important — it means that no WebGL websites will work, and more important, most video won’t play (because they often use hardware rendering to play)
I am working to remove these limitations.
Video demo
Download
Checkout the extension on the Unity Asset store
VR Configuration
Tested with Google Daydream and Google Cardboard
other VR SDK could work but there is no guarantee.
You must have a Google VR Unity version (-GVRXX) or use the last Unity beta (5.6)
Your build parameters (found in Build Settings > Player Settings) should look like this:
Events mechanism
The Webview will give you delegate messages for specific events:
- onPageStarted:string => when a new url is about to be loaded
- onPageFinished:string => when a new url has finished to load
- onReceivedError:string => when an error happen
you can parse these messages and handle it as you wish
This script takes advantage of the Unity Event System, so you must add an EventSystem to your scene (with default value) and also a Physics Raycaster on your main camera (with default value)
That way you can send touch event to the Webview, this will allow you to click links, scroll the view and much more.
You can find a working example here: https://gist.github.com/jrmgx/793fb62e575a63d08ac13b16cb34be19
This example is integrated in version 1.2 of the Asset.
Non VR example
This Webview will act like a classic texture, usage are limit-less:
Support
Ask your questions here: Android Webview Texture - Jérôme Gangneux


