Skip to content

Latest commit

 

History

History
131 lines (98 loc) · 4.56 KB

README.md

File metadata and controls

131 lines (98 loc) · 4.56 KB

TLabWebView

日本語版READMEはこちら

Plug-in to use Android WebView as uGUI (Texture2D)

  • Keyboard Input
  • Touch Interaction
  • File download (include blob, data url)
  • Resize
  • Run Javascript

Document is here
Snippets is here
The Java plugin source code is here

"Buy Me A Coffee"

Unity version this plugin supports

  • Unity 2021
  • Unity 2022

Graphics api this plugin supports

  • OpenGLES
  • Vulkan

Screenshot

Screenshot run on Android 13, Adreno 619

Operating Environment

OS Android 10 ~ 14
GPU Qualcomm Adreno 505, 619
Unity 2021.3

Getting Started

Requirements

Installing

Please see here

Submodule

Clone this repository with the following command

git clone https://github.com/TLabAltoh/TLabWebView.git

or

git submodule add https://github.com/TLabAltoh/TLabWebView.git

UPM

add package from git URL ...

https://github.com/TLabAltoh/TLabWebView.git#upm

Set Up

Please see here
  • Build Settings
Property Value
Platform Android
  • Project Settings
Property Value
Color Space Linear
Minimum API Level 26
Target API Level 30 (Unity 2021), 31 ~ 32 (Unity 2022)
  • Add the following symbols to Project Settings --> Player --> Other Settings (to be used at build time)
UNITYWEBVIEW_ANDROID_USES_CLEARTEXT_TRAFFIC
UNITYWEBVIEW_ANDROID_ENABLE_CAMERA
UNITYWEBVIEW_ANDROID_ENABLE_MICROPHONE

Prefab

Prefab is here. Just add prefab to the canvas to implement webview

/Resources/TLabWebView.prefab

Note

If you want to download the file to external storage (like /Download, /Picture), please add the following permission to the manifest. This is required for Android 11+ (see here for more details).

<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />

Warning

Android WebView doesn't support the WebXR API.

Warning

OculusQuest doesn't support some HTML5 input tags (see below). If you want to use them, please enable the useCustomWidget property of the TLabWebView class. It will display a widget implemented by this plugin on the WebView instead of the standard Android widget. Below is the status of html5 input tag support by this plugin's custom widget.

Also, currently custom input widget implemented by this plugin uses javascript and disable pointer event (onmousedown, onclick). Please note that this implementation has possibility to cause problem on some website.

Warning

This plugin supports both Vulkan and OpenGLES, but if you are building an application that uses a Vulkan graphics API, the Android device must support OpenGLES (3.1+) as well as Vulkan.