Home > Mobile >  Webview white set webview. SetLayerType (the LAYER_TYPE_SOFTWARE, null) after the video playback
Webview white set webview. SetLayerType (the LAYER_TYPE_SOFTWARE, null) after the video playback

Time:03-31

some webview other Settings
Val webView: the webView=contentWV
Val Settings=webView. Settings
Settings. JavaScriptEnabled=true
//Settings. UseWideViewPort=true
//Settings. LoadWithOverviewMode=true
Settings. AllowFileAccess=true
Settings. SetSupportZoom (true)
Settings. JavaScriptCanOpenWindowsAutomatically=true
Settings. LayoutAlgorithm=WebSettings. LayoutAlgorithm. NARROW_COLUMNS
Settings. MediaPlaybackRequiresUserGesture=false
Settings. AllowUniversalAccessFromFileURLs=true

WebView. SetLayerType (the LAYER_TYPE_SOFTWARE, null)
Settings. PluginState=WebSettings. PluginState. ON
Settings. DomStorageEnabled=true//must be retained, otherwise you won't play youtube video, other OK

If (Build) VERSION) SDK_INT & gt;=Build. VERSION_CODES. LOLLIPOP) {
Settings. MixedContentMode=WebSettings. MIXED_CONTENT_ALWAYS_ALLOW
}
//contentWV. LoadUrl (" file:///sdcard/ExpCourse/Power1stClass/3.html ")

WebView. WebViewClient=object: webViewClient () {
Override fun onPageStarted (
View: the WebView? ,
Url: the String? ,
The favicon: Bitmap?
) {
Logd (" onPageStarted: $url ")
Super. OnPageStarted (view, url, favicon)
}

Override fun onPageFinished (view: the WebView? , the url: String? {
Logd (" onPageFinished: $url ")
Super. OnPageFinished (view, url)
}
}

manifest hardware acceleration is on android: hardwareAccelerated="true"

CodePudding user response:

For bosses to see see
  • Related