Matisse.obtainResult() and Matisse.obtainPathResult() returns list of path and URI . So how can i check whether the path contains an image of a video . In case of Video i need to load the thumbnail from video and also play it . I am using code below .
Matisse.from(this)
.choose(MimeType.of(MimeType.JPEG,MimeType.PNG,MimeType.MP4,MimeType.MPEG),false)
.countable(true)
.maxSelectable(10)
.showSingleMediaType(false)
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
.thumbnailScale(0.85f)
.imageEngine(new PicassoEngine())
.forResult(5);
Please let me know Is there a way with Matisse to get this type of result ? I am stuck here for 5 days now. Is it possible with Matisse or not ?
MimeType.java#checkType(ContentResolver resolver, Uri uri)
List<Uri> mSelected;
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_CHOOSE && resultCode == RESULT_OK) {
mSelected = Matisse.obtainResult(data);
Log.d("Matisse", "mSelected: " + mSelected);
//
String type = "image";
for (MimeType mt : MimeType.ofVideo()) {
if (mt.checkType(resolver, mSelected.get(0))) {
type = "video";
break;
}
}
}
}
Most helpful comment
MimeType.java#checkType(ContentResolver resolver, Uri uri)