为 Android WebView 启用 WebGL 支持 [英] Enabling WebGL support for Android WebView

查看:61
本文介绍了为 Android WebView 启用 WebGL 支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的 web 视图中显示 WebGL 图形.有什么方法可以修改Android WebView 以启用WebGL.如果是,如何?

I need to display WebGL graphics in my webview. Is there any way to modify Android WebView to enable WebGL. If yes, How?

推荐答案

在 Android Lollipop 之前的 WebViews 中不支持 WebGL.在 KitKat 中,Android 切换到 Chromium 作为原生 WebView 实现,但它被锁定到 Chromium 33,没有 WebGL.在 Lollipop 中,WebView 通过 Play Store 更新,现在支持 WebGL.(来源:https://developer.chrome.com/multidevice/webview/overview)

WebGL was not supported in WebViews before Android Lollipop. In KitKat, Android switched to Chromium as the native WebView implementation, but it is locked to Chromium 33, with no WebGL. In Lollipop, WebView is updated via the Play Store, and now supports WebGL. (source: https://developer.chrome.com/multidevice/webview/overview)

试图扩展 WebView 以支持它几乎是不可能的.

Trying to extend WebView to support it is next to impossible.

您可能会考虑的一件事是使用 CSS 3D 转换而不是 WebGL,Android ICS 和转发支持这些转换,请参阅 http://caniuse.com/#feat=transforms3d

One thing you might consider, is use CSS 3D transformations instead of WebGL, those are supported on Android ICS and forward, see http://caniuse.com/#feat=transforms3d

这篇关于为 Android WebView 启用 WebGL 支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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