I am launching Mx Player from my Application to play a video. But this error came when I am playing video.
No activity found to handle intent { act=android.intent.action.View }
Here's my code. I have created a method for playing video when I directly put a link in play ( "http://www.example.com/dfgdf/grft.ts"
) it plays
public void onClick(View v){
int position = getLayoutPosition();
final M3UItem imm = mItem.get(position);
removeLastChar(imm.getItemUrl());
Toast.makeText(mContext, "Url: "+imm.getItemUrl(), Toast.LENGTH_LONG).show();
playy(imm.getItemUrl());
}
public void playy(String uriil){
try{
Intent intent = new Intent();
Uri videoUri = Uri.parse(uriil);
intent.setDataAndTypeAndNormalize(videoUri, "application/x-mpegURL" );
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setPackage( "com.mxtech.videoplayer.ad" );
mContext.startActivity( intent );
} catch (Exception e) {
Toast.makeText(mContext, "Error: "+e.getMessage(), Toast.LENGTH_LONG).show();
}
// Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
// mContext.startActivity(marketIntent);
}
You can play your video in available video player in your Android Phone as follows
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(uriil), "video/*");
startActivity(Intent.createChooser(intent, "PLay video..."));
If you want to stream your video in Mx Player then follow this POST
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.