[英]WebGL in Android WebView
I know this has been asked before but those questions are pretty old now. 我知道之前已经问过,但这些问题现在已经很久了。 I have a "game" that I developed some time ago with WebGL and I want to bring it to Android with a simple WebView.
我有一段时间用WebGL开发的“游戏”,我希望用简单的WebView将它带到Android。 The problem now is, that it won't really respond to the user input in the WebView (Chrome works just fine. Android 7.1.1) .
现在的问题是,它不会真正响应WebView中的用户输入(Chrome工作正常.Android 7.1.1)。 I guess that's because of WebGL.
我猜这是因为WebGL。
So now, as the crosswalk-project has ended a while ago I am searching for an alternative to run WebGL in my application. 所以现在,由于crosswalk项目已经结束了一段时间,我正在寻找在我的应用程序中运行WebGL的替代方案。 Or somehow just run my "game" in an Android App.
或者以某种方式在Android应用程序中运行我的“游戏”。
Do you have any idea of how I could bring it to work? 你知道我怎么能把它带到工作中吗?
From 5.0 Android comes with Android System WebView which is being updated and we might call it the Native WebView
. 从Android 5.0开始, Android System WebView正在更新,我们可能将其称为
Native WebView
。 WebGL should work there although some of WebGL extensions and WebGL 2 ( stats ) might not. WebGL应该在那里工作,尽管一些WebGL扩展和WebGL 2( 统计数据 )可能不会。
The key to make your game work as an application is following. 让您的游戏作为应用程序工作的关键是遵循。
First you must identify what WebGL version, WebGL extensions, WebGL or Shader capabilities and other HTML5 functionality your game (and the game engine you use) requires. 首先,您必须确定您的游戏(以及您使用的游戏引擎)所需的WebGL版本,WebGL扩展,WebGL或Shader功能以及其他HTML5功能。
Then you must find a WebView that supports that functionality. 然后,您必须找到支持该功能的WebView。 You can simply do that by opening webpages https://html5test.com/ and http://webglreport.com/ with the WebView you want on your Android device.
您可以通过在Android设备上使用您想要的WebView打开网页https://html5test.com/和http://webglreport.com/来实现这一目的。 IMPORTANT!
重要! If you for example open the webpage with installed Chrome browser, it doesn't guarantee the Native WebView is used!
例如,如果您打开安装了Chrome浏览器的网页,则无法保证使用Native WebView! So it is better to write a small custom application to make sure you are testing the WebView you want to use for the game.
因此,最好编写一个小型自定义应用程序,以确保您正在测试要用于游戏的WebView。
In the end you will probably end up with compiling your game in application with custom WebView which will add an additional size to your game. 最后,您可能最终会在应用程序中使用自定义WebView编译您的游戏,这将为您的游戏增加额外的大小。
Other useful informations 其他有用的信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.