1

I have a link to 360 Image for the mobile site but I want to load that in WebView in my App. Link works perfectly on the native mobile browser as well as Google Chrome, but not in the WebView in my App.

Any help is Appreciated. Thanks.

kashyap jimuliya
  • 839
  • 10
  • 21
  • My guess is that 360/VR needs WebGL to work in a WebView but that isn't consistent from device to device: https://stackoverflow.com/q/35746920/295004 and https://bugs.chromium.org/p/chromium/issues/detail?id=472312 – Morrison Chang May 26 '17 at 06:58
  • @MorrisonChang what is the work around or is there any other solution that I can use to show 360 as well as VR Image in my App? – kashyap jimuliya May 26 '17 at 07:01

2 Answers2

1

Lately, but I think this will helpful to someone. In your activity using webview, set this in androidmanifests set: android:hardwareAccelerated="true" And my webview like this:

webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setAllowFileAccess(true);
    webView.getSettings().setPluginState(WebSettings.PluginState.ON);
    webView.getSettings().setDomStorageEnabled(true);
    webView.getSettings().setAllowContentAccess(true);
    webView.getSettings().setLoadsImagesAutomatically(true);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        webView.getSettings().setAllowFileAccessFromFileURLs(true);
    }
    webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);

    webView.setWebChromeClient(new WebChromeClient());

Try this, It will work perfectly!

TedVN
  • 476
  • 5
  • 10
0

I have implemented Google VR library for it to be implemented as I did not find it to be workable in WebView.

//VR
 compile 'com.google.vr:sdk-audio:1.10.0'
 compile 'com.google.vr:sdk-base:1.10.0'
 compile 'com.google.vr:sdk-common:1.10.0'
 compile 'com.google.vr:sdk-commonwidget:1.10.0'
 compile 'com.google.vr:sdk-panowidget:1.10.0'
 compile 'com.google.vr:sdk-videowidget:1.10.0'
kashyap jimuliya
  • 839
  • 10
  • 21