diff --git a/app/build.gradle b/app/build.gradle index 4543078..5a6a9ed 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { //noinspection ExpiredTargetSdkVersion targetSdk 26 versionCode 4 - versionName '1.7.0-release' + versionName '1.7.1-release' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/com/huozige/lab/container/webview/HACWebView.java b/app/src/main/java/com/huozige/lab/container/webview/HACWebView.java index 2fc7b2f..07c3a74 100644 --- a/app/src/main/java/com/huozige/lab/container/webview/HACWebView.java +++ b/app/src/main/java/com/huozige/lab/container/webview/HACWebView.java @@ -6,15 +6,11 @@ import android.content.pm.PackageManager; import android.util.Log; import android.view.View; -import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; -import android.webkit.WebViewClient; import android.widget.LinearLayout; import android.widget.ProgressBar; -import androidx.appcompat.app.AppCompatActivity; - import com.huozige.lab.container.utilities.ConfigManager; /** @@ -78,6 +74,9 @@ public HACWebView(Context context) { settings.setBuiltInZoomControls(false); // 不显示缩放按钮 settings.setSupportZoom(false); // 不允许缩放 + // 兼容性 + settings.setMediaPlaybackRequiresUserGesture(false); // 允许页面加载时自动播放音频 + // 启用Debug(全局设置) WebView.setWebContentsDebuggingEnabled(true); // 使用Chrome调试网页,需要开启这个 @@ -137,10 +136,6 @@ public void refreshWebView() { this.loadUrl(target); } - public AppCompatActivity getActivityContext() { - return (AppCompatActivity)_context; - } - /** * 页面导航或加载脚本 * 记录日志