This question is actually asked and supposedly answered here: android get video thumbnail PATH, not Bitmap.
I've tried several times but can't get it to work. I always get a null returned. Any help on this please?
Edit: The sample code I'm using now:
public static String getVideoThumbnailPath(Context context,
String filePath) {
String thubmnailPath;
String where = Video.Thumbnails.VIDEO_ID
+ " In ( select _id from video where _data =?)";
final String[] VIDEO_THUMBNAIL_TABLE = new String[] { Video.Media._ID, // 0
Video.Media.DATA, // 1
};
Uri videoUri = MediaStore.Video.Thumbnails.getContentUri("external");
Cursor c = context.getContentResolver().query(videoUri,
VIDEO_THUMBNAIL_TABLE, where, new String[] { filePath }, null);
if ((c != null) && c.moveToFirst()) {
thubmnailPath = c.getString(1);
c.close();
Log.i(TAG, "thumb path: " + thubmnailPath);
return thubmnailPath;
} else {
c.close();
Log.i(TAG, "thumb path is null");
return null;
}
}