admin
6 天以前 7f0825f8195a522ed7e8bcdb6347f3a719e06c74
BuWanVideo/src/com/weikou/beibeivideo/ui/video/VideoPlayerBrowserActivity.java
@@ -53,6 +53,7 @@
import com.weikou.beibeivideo.util.ui.TopStatusSettings;
import com.yeshi.video.player.util.PlayerFullScreenUtil;
import java.net.URI;
import java.util.Set;
public class VideoPlayerBrowserActivity extends BaseActivity implements OnClickListener {
@@ -186,6 +187,7 @@
                    prefixSet.add("iqiyi://");
                    prefixSet.add("youku://");
                    prefixSet.add("imgotv://");
                    prefixSet.add("txvideo://");
                    for (String prefix : prefixSet) {
                        if (url.startsWith(prefix)) {
@@ -199,6 +201,33 @@
                    }
                    return true;
                }
                else if (url.contains("/a.app.qq.com/")&&url.contains("com.qiyi.video")) {
                    Uri uri =   Uri.parse(url);
                    if(uri!=null) {
                        String packageName = uri.getQueryParameter("pkgname");
                        if(packageName==null){
                            return false;
                        }
                        runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                Toast.makeText(VideoPlayerBrowserActivity.this, "正在打开应用市场...", Toast.LENGTH_SHORT).show();
                            }
                        });
                        try {
                            // 优先尝试Google Play
                            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + packageName)));
                        } catch (ActivityNotFoundException e) {
                            // 如果Google Play不存在,尝试其他市场
                            try {
                                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("amzn://apps/android?p=" + packageName)));
                            } catch (ActivityNotFoundException e2) {
                            }
                        }
                        return true;
                    }
                }
                return super.shouldOverrideUrlLoading(view, request);