admin
2021-04-07 cbb88109494ffc7916f6639c20ce05c0cec941a9
BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java
@@ -4,6 +4,7 @@
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
@@ -47,12 +48,15 @@
import com.weikou.beibeivideo.R;
import com.weikou.beibeivideo.ui.BaseActivity;
import com.weikou.beibeivideo.ui.media.VideoDetailActivity2;
import com.weikou.beibeivideo.util.ConfigUtil;
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.ui.TopStatusSettings;
import com.weikou.beibeivideo.widget.CustomWebView;
import com.yeshi.video.player.util.PlayerFullScreenUtil;
import java.util.Set;
public class VideoPlayerBrowserActivity extends BaseActivity implements OnClickListener {
@@ -113,9 +117,15 @@
            public void onClick(View v) {
                hiddenMenu();
                String url = tv_url.getText().toString();
                Uri uri = Uri.parse(url);
                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                startActivity(intent);
                try {
                    Uri uri = Uri.parse(url);
                    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                    startActivity(intent);
                } catch (ActivityNotFoundException e) {
                    Toast.makeText(VideoPlayerBrowserActivity.this, "无法找到浏览器", Toast.LENGTH_SHORT).show();
                } catch (Exception e) {
                }
            }
        });
@@ -173,16 +183,26 @@
                    return true;
                } else if (url.contains("/tbopen/") || url.startsWith("tbopen://")) {
                    return true;
                } else if (url.startsWith("tenvideo2://") || url.startsWith("iqiyi://") || url.startsWith("youku://") || url.startsWith("imgotv://")) {
                    try {
                        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
                        startActivity(intent);
                    } catch (Exception e) {
                } else if (!url.startsWith("http")) {
                    Set<String> prefixSet = ConfigUtil.getPlayerJumpOutProtocolPrefix(getApplicationContext());
                    prefixSet.add("tenvideo2://");
                    prefixSet.add("iqiyi://");
                    prefixSet.add("youku://");
                    prefixSet.add("imgotv://");
                    for (String prefix : prefixSet) {
                        if (url.startsWith(prefix)) {
                            try {
                                Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
                                startActivity(intent);
                            } catch (Exception e) {
                            }
                            return true;
                        }
                    }
                    return true;
                } else if (!url.startsWith("http"))
                    return true;
                }
                return super.shouldOverrideUrlLoading(view, request);
            }