我想要一种方法来设置MX播放器以在我的应用程序中播放视频。
答案 0 :(得分:0)
这将启动任何已安装的MX Player版本(未测试)。您需要向意图添加数据才能播放视频。祝你的应用好运。
Intent intent;
PackageManager packageManager=getPackageManager();
try {
intent= packageManager.getLaunchIntentForPackage("com.mxtech.videoplayer.pro");
if (null != intent)this.startActivity(intent);
}
catch (ActivityNotFoundException e) {
//MX Player pro isn't installed
try{
intent= packageManager.getLaunchIntentForPackage("com.mxtech.videoplayer.ad");
if (null != intent)this.startActivity(intent);
}
catch (ActivityNotFoundException e) {
//No version of MX Player is installed.You should let the user know
}
}