Android WebView 播放视频问题

硬件加速(三种)

  1. Application级别
  2. Activity级别
  3. View级别
    webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

https和http混合请求问题

当一个WebView中的请求同时出现Https和Http时,可能会报出错误:

Mixed Content: The page at 'https://....' was loaded over HTTPS,
but requested an insecure video 'http://....'. 
This request has been blocked; the content must be served over HTTPS.

在WebViewSetting中设置

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {      
    webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
}

你可能感兴趣的:(Android)