File tree Expand file tree Collapse file tree
libTLabWebView/src/main/java/com/tlab/webkit/chromium Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -565,8 +565,7 @@ public void Dispose() {
565565 abortCaptureThread ();
566566
567567 mWebView .stopLoading ();
568- if (mVideoView != null )
569- mWebView .removeView (mVideoView );
568+ if (mVideoView != null ) mWebView .removeView (mVideoView );
570569 mWebView .destroy ();
571570 mWebView = null ;
572571 mView = null ;
@@ -582,7 +581,11 @@ public void EvaluateJS(String js) {
582581 final Activity a = UnityPlayer .currentActivity ;
583582 a .runOnUiThread (() -> {
584583 if (mWebView == null || !mWebView .getSettings ().getJavaScriptEnabled ()) return ;
585- mWebView .loadUrl ("javascript:(function(){" + js + "})();" );
584+ if (android .os .Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .KITKAT ) {
585+ mWebView .evaluateJavascript ("(function(){" + js + "})();" , null );
586+ } else {
587+ mWebView .loadUrl ("javascript:(function(){" + js + "})();" );
588+ }
586589 });
587590 }
588591
You can’t perform that action at this time.
0 commit comments