AR.js专题-安卓-WebView支持


WebRTC支持

报错:Webcam Error

navigator.mediadevices.getusermedia not present in your browser

 

解决办法:

// 重新WebChromeClient

public class MWebChromeClient extends WebChromeClient {

    /**

     * 支持WebRTC

     * @param request

     */

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)

    @Override

    public void onPermissionRequest(PermissionRequest request) {

        request.grant(request.getResources());

    }

}

Ref:

https://github.com/oauth-io/oauth-android/issues/2

 

 

HTTPS SSL证书报错问题

报错:TAG: X509Util - Failed to validate the certificate chain

error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

解决办法:

// 重新WebViewClient

public class MWebViewClient extends WebViewClient {

    /**

     * 解决SSL证书错误问题

     * @param view

     * @param handler

     * @param error

     */

    @Override

    public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {

        handler.proceed();

    }

}

Ref:

https://stackoverflow.com/questions/22376202/camera-not-opening-in-webview

https://github.com/marcusbelcher/android-getUserMedia-test

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM