MX-Player wird geöffnet, anstatt das Video absichtlich abzuspielenJava

Java-Forum
Guest
 MX-Player wird geöffnet, anstatt das Video absichtlich abzuspielen

Post by Guest »

Ich versuche, dem Benutzer eine Option zum Abspielen von Videos im MX Player zu geben, aber es sieht so aus, als ob die App nur geöffnet wird, anstatt das Video tatsächlich abzuspielen. Kann mir hier bitte jemand helfen?Mein Code:

Code: Select all

String videoStreamUrl = null;
Intent intent;

if (type.equals("movie")) {
if (listDirector.get(0).getStremURL() != null) {
videoStreamUrl = commonVideoUrl;
}
}else{
videoStreamUrl = commonVideoUrl;
}
if(videoStreamUrl!=null) {
PackageManager packageManager=getPackageManager();
try {
intent= packageManager.getLaunchIntentForPackage("com.mxtech.videoplayer.pro");
if (null != intent)
intent.setDataAndType(Uri.parse(videoStreamUrl), "video/*");
startActivity(intent);
}
catch (ActivityNotFoundException e) {
//MX Player pro isn't installed
try{
intent= packageManager.getLaunchIntentForPackage("com.mxtech.videoplayer.ad");
if (null != intent)
intent.setDataAndType(Uri.parse(videoStreamUrl), "video/*");
startActivity(intent);
}
catch (ActivityNotFoundException er) {
//No version of MX Player is installed.You should let the user know
}
}
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post