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