Answer the question
In order to leave comments, you need to log in
How to make MediaStore find more videos in different formats on the device?
To play local videos with non-standard encoding, I added MXPlayer support to the application. But the problem is that I first need to show the list of videos on the device to the user in my UI.
Now the program takes a list of videos on the device like this:
String[] projection = new String[]{MediaStore.Video.Media._ID, MediaStore.Video.Media.DATA, MediaStore.Video.Media.TITLE};
Cursor cursor = activity.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, projection, null, null, null);
while (cursor.moveToNext()) {
if (MediaStore.Video.Thumbnails.getThumbnail(activity.getContentResolver(), cursor.getLong(0), MediaStore.Video.Thumbnails.MINI_KIND, null) != null) {
publishProgress(new Pair<>(cursor.getLong(0), cursor.getString(2)));
}
}
cursor.close();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question