在Android上5的支持网页视图的WebGL [英] Supporting WebGL on Android 5's WebView

查看:1489
本文介绍了在Android上5的支持网页视图的WebGL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个web项目(取决于WebGL的),它的工作原理的计算机上,任何浏览器。现在,我想这个项目被打开作为基于Android手机的应用程序。我用的WebView做到这一点。我的手机(3的Nexus)有搭载Android 4.3和Android的我前5事后了解到,组件的WebView不支持WebGL。借助Android 5,成为网页视图取决于铬37版可更新的独立成分(可更新),并开始支持WebGL。所以我与Android 4.3得到错误的预期。

这我用另一部手机(三星galaxy S4采用Android 5并在其上的Chrome版本43)试过后。所以,那么应用程序应该效果不错,但仍然有上的WebView错误。我试着 get.webgl.org 还是一样的错误:

 错误构建CesiumWidget。访问http://get.webgl.org以验证您的Web浏览器和硬件支持WebGL。考虑尝试不同的网络浏览器或更新您的视频驱动程序。

详细的错误信息如下:

  RuntimeError:浏览器支持WebGL的,但初始化失败。

错误

 在新RuntimeError(http://192.168.43.125:8090/TMAPW/lib/Cesium/Build/CesiumUnminified/Cesium.js:10657:19)
在新的上下文(http://192.168.43.125:8090/TMAPW/lib/Cesium/Build/CesiumUnminified/Cesium.js:96489:19)
在新场景(http://192.168.43.125:8090/TMAPW/lib/Cesium/Build/CesiumUnminified/Cesium.js:120928:23)
在新CesiumWidget(http://192.168.43.125:8090/TMAPW/lib/Cesium/Build/CesiumUnminified/Cesium.js:130986:25)
在AMouseListener.Map2D.initWidget

这仍似乎是一个配置问题,所以后来我试图打开这个在Chrome不是的WebView但仍相同的错误。我下面instuctions启用WebGL的浏览器上。 `Firefox的正常工作,但。我有三个问题:


  1. 请问似乎有什么我做错了,我该怎么解决这个问题?


  2. Android版是否仍然不支持WebGL的网页视图,不存在任何可能的方式来打开WebGL的应用程序依赖?


  3. 是否有任何其他方式打开WebGL的项目作为一个应用程序。 (我读过关于科尔多瓦 cocoon.js ,但不能确定是否可以通过这些来完成。)所以,如果其中有一个正常工作,我宁愿直接去了。



解决方案

我建议你试试人行横道,基于铬/闪烁

https://crosswalk-project.org/documentation/samples/webgl.html

I have a web project (depends on WebGL) which works on computers, any browser. Now I am trying this project to be opened as an application on Android based mobile phones. I used WebView to accomplish this. My phone (Nexus 3) had Android 4.3 and as I learnt afterwards before Android 5, WebView component didn't support WebGL. With Android 5, WebView became an updatable independent component which depends on Chromium version 37 (can be updated) and started to support WebGL. So the error I was getting with Android 4.3 is expected.

After this I tried using another phone (Samsung galaxy S4 with Android 5 and Chrome version 43 on it). So then the application should have worked well, but still got error on WebView. I tried get.webgl.org still the same error:

Error constructing CesiumWidget.

Visit http://get.webgl.org to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers.

Detailed error information is below:

RuntimeError: The browser supports WebGL, but initialization failed.

Error

at new RuntimeError (http://192.168.43.125:8090/TMAPW/lib/Cesium/Build/CesiumUnminified/Cesium.js:10657:19)
at new Context (http://192.168.43.125:8090/TMAPW/lib/Cesium/Build/CesiumUnminified/Cesium.js:96489:19)
at new Scene (http://192.168.43.125:8090/TMAPW/lib/Cesium/Build/CesiumUnminified/Cesium.js:120928:23)
at new CesiumWidget (http://192.168.43.125:8090/TMAPW/lib/Cesium/Build/CesiumUnminified/Cesium.js:130986:25)
at AMouseListener.Map2D.initWidget 

This still seemed like a configuration problem, so then I tried to open this on Chrome not on WebView yet still the same error. I enabled WebGL on Chrome following instuctions. `Firefox works fine though. I have three questions:

  1. Does there seem to be anything I am doing wrong, how can I fix it?

  2. Does Android still not support WebGL on WebView, isn't there any possible way to open WebGL dependent applications?

  3. Is there any other way to open a WebGL project as an application. (I have read about cordova and cocoon.js but not sure if it can be accomplished through these.) So if there is one which works fine I'd rather go directly for it.

解决方案

I suggest you try CrossWalk, based on Chromium/blink

https://crosswalk-project.org/documentation/samples/webgl.html

这篇关于在Android上5的支持网页视图的WebGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆