Skip to content

Commit

Permalink
修复“未定义”错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Eanya-Tonic committed Sep 22, 2024
1 parent 6eed934 commit f81887b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/src/main/java/com/eanyatonic/cctvViewer/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class MainActivity extends AppCompatActivity {

private WebView webView0; // 导入 WebView
private WebView webView1; // 导入备用 WebView
private boolean canLoadX5 = false;

private int currentWebView = 0; //正在使用的webView
private boolean isChanging = false; //是否正在换台
Expand Down Expand Up @@ -264,7 +265,7 @@ protected void onCreate(Bundle savedInstanceState) {
if (!forceSysWebView) {
copyAssets(this, "045738_x5.tbs.apk", "/data/user/0/com.eanyatonic.cctvViewer/app_tbs/045738_x5.tbs.apk");

boolean canLoadX5 = QbSdk.canLoadX5(getApplicationContext());
canLoadX5 = QbSdk.canLoadX5(getApplicationContext());
Log.d("canLoadX5", String.valueOf(canLoadX5));
if (canLoadX5) {

Expand Down Expand Up @@ -596,11 +597,9 @@ function AutoFullscreen(){
webView1.setFocusable(false);

// 开启无图(X5内核)
if (!forceSysWebView) {
if (canLoadX5) {
webView0.getSettingsExtension().setPicModel(IX5WebSettingsExtension.PicModel_NoPic);
webView1.getSettingsExtension().setPicModel(IX5WebSettingsExtension.PicModel_NoPic);
}
if (canLoadX5) {
webView0.getSettingsExtension().setPicModel(IX5WebSettingsExtension.PicModel_NoPic);
webView1.getSettingsExtension().setPicModel(IX5WebSettingsExtension.PicModel_NoPic);
}
// 设置 WebView 客户端
webView0.setWebChromeClient(new WebChromeClient());
Expand Down

0 comments on commit f81887b

Please sign in to comment.