| | |
| | | import android.app.NotificationManager; |
| | | import android.content.Intent; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.content.res.Configuration; |
| | | import android.graphics.BitmapFactory; |
| | | import android.graphics.Color; |
| | | import android.graphics.PixelFormat; |
| | |
| | | import android.view.View.OnClickListener; |
| | | import android.view.ViewGroup; |
| | | import android.view.WindowManager; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.ImageView; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.LinearLayout.LayoutParams; |
| | |
| | | import com.tencent.smtt.sdk.WebView; |
| | | import com.tencent.smtt.sdk.WebViewClient; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.ui.BaseActivity; |
| | | import com.weikou.beibeivideo.ui.media.VideoDetailActivity; |
| | | import com.weikou.beibeivideo.util.browser.BWJavaInterface; |
| | | import com.weikou.beibeivideo.util.downutil.DownFiles; |
| | | import com.weikou.beibeivideo.util.downutil.DownFiles.IProgress; |
| | | import com.weikou.beibeivideo.util.x5.X5WebView; |
| | | import com.weikou.beibeivideo.R; |
| | | import com.weikou.beibeivideo.util.x5.X5PlayerWebView; |
| | | import com.tencent.smtt.export.external.interfaces.IX5WebChromeClient.CustomViewCallback; |
| | | |
| | | /** |
| | | * 视频播放网页 |
| | |
| | | private TextView tv_title; |
| | | private TextView tv_url; |
| | | private ImageView iv_refresh; |
| | | private X5WebView webview; |
| | | private X5PlayerWebView webview; |
| | | ProgressBar progressBar; |
| | | |
| | | |
| | | private void initX5WebView() { |
| | | webview = findViewById(R.id.webview); |
| | | FrameLayout webViewContainer = findViewById(R.id.webview_container); |
| | | webview = new X5PlayerWebView(this, null); |
| | | webViewContainer.addView(webview, new FrameLayout.LayoutParams( |
| | | FrameLayout.LayoutParams.MATCH_PARENT, |
| | | FrameLayout.LayoutParams.MATCH_PARENT)); |
| | | webview.setDownloadListener(new MyWebViewDownLoadListener()); |
| | | |
| | | webview.setWebViewClient(new WebViewClient() { |
| | | @Override |
| | | public boolean shouldOverrideUrlLoading(WebView view, String url) { |
| | |
| | | */ |
| | | @Override |
| | | public void onShowCustomView(View view, |
| | | IX5WebChromeClient.CustomViewCallback customViewCallback) { |
| | | LinearLayout normalView = (LinearLayout) findViewById(R.id.ll_content); |
| | | CustomViewCallback customViewCallback) { |
| | | LinearLayout normalView = (LinearLayout) findViewById(R.id.ll_container); |
| | | ViewGroup viewGroup = (ViewGroup) normalView.getParent(); |
| | | viewGroup.removeView(normalView); |
| | | viewGroup.addView(view); |
| | |
| | | } else { |
| | | findViewById(R.id.v_status_bar).setVisibility(View.GONE); |
| | | } |
| | | initX5WebView(); |
| | | |
| | | tv_title = findViewById(R.id.tv_title); |
| | | tv_url = findViewById(R.id.tv_url); |
| | | iv_refresh = findViewById(R.id.iv_refresh); |
| | |
| | | progressBar.setMax(100); |
| | | progressBar.setProgressDrawable(this.getResources() |
| | | .getDrawable(R.drawable.color_progressbar)); |
| | | initX5WebView(); |
| | | webview.loadUrl(getIntent().getStringExtra("url")); |
| | | |
| | | String url = getIntent().getStringExtra("url"); |
| | | webview.loadUrl(url); |
| | | tv_url.setText(webview.getUrl()); |
| | | } |
| | | // 文件下载监听 |
| | |
| | | public void onResume() { |
| | | super.onResume(); |
| | | MobclickAgent.onPageStart("网页"); |
| | | webview.reload(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | return super.onKeyDown(keyCode, event); |
| | | } |
| | | |
| | | @Override |
| | | public void onConfigurationChanged(Configuration newConfig) { |
| | | super.onConfigurationChanged(newConfig); |
| | | } |
| | | } |