Jump to content

Default Android Browser Detection


Recommended Posts

Hm, still not working, whats wrong with this stupid Android Browser...

var isSupported = function () {    try {        var tempcanvas = document.createElement('canvas');        var gl = tempcanvas.getContext('webgl') || tempcanvas.getContext('experimental-webgl');        gl.enable(gl.DEPTH_TEST);        return BABYLON.Engine.isSupported();    } catch (e) {        return false;    }};

After I copy pasted a ShaderCompiler I tried something different. Seems like the Android Browser has a very very experimental-webgl context.

This example works


and this doesn't



The only difference is the Texture.

var isSupported = function () {    var nua = navigator.userAgent.toLowerCase();    var is_android = ((nua.indexOf('mozilla/5.0') > -1 && nua.indexOf('android ') > -1 && nua.indexOf('applewebkit') > -1) && !(nua.indexOf('chrome') > -1));                return !(is_android || !BABYLON.Engine.isSupported());};

Seems to work fine.



Link to comment
Share on other sites

  • 2 weeks later...

Hmm ? Something here sound strange to my ears... Android default browser actually supports WebGL pretty well (even better than FF mobile or Chrome mobile, better FPS).


FYI : except for one stupid fracking piece of code : camera.attachControl(canvas, true);  with false everything is ok, but with true, there are inner awfull conflicts, finger swiping on screen results in scene AND html page trying to go both up and down at same time, resulting in a happy jiggle dance (no problem in FF or Chrome mobile, expected behavior happens : swiping finger up rotates camera down AND scrolls page down at same time).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...