【问题标题】:Unable to load the 360 (also VR) image in webView无法在 webView 中加载 360(也是 VR)图像
【发布时间】:2017-05-26 06:48:32
【问题描述】:

我有一个移动网站的 360 Image 链接,但我想在我的应用程序的 WebView 中加载它。 Link 在本机移动浏览器和 Google Chrome 上都能完美运行,但在我的应用程序的 WebView 中却不行。

感谢任何帮助。 谢谢。

【问题讨论】:

标签: android webview android-webview 360-virtual-reality


【解决方案1】:

最近,但我认为这会对某人有所帮助。在您使用 webview 的活动中,在 androidmanifests 集中设置:android:hardwareAccelerated="true" 我的 webview 如下所示:

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());

试试这个,效果很好!

【讨论】:

    【解决方案2】:

    我已经实现了 Google VR 库,因为我发现它在 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'
    

    【讨论】:

      猜你喜欢
      • 2011-02-27
      • 2013-03-30
      • 1970-01-01
      • 2013-11-26
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多