I create thumbnails from videos stored on my SD card, displaying thumbnails and their names in a grid. On the selected element, the grid event opens a dialog box and sets x, y, right, lower positions, then inserts it into the main action. I received video files and tried to create a sketch using the media store, I also get a thumbnail as a bitmap, but the bitmap is null. In grid mode, the video names are displayed, and I can select the appropriate thumbnail and give positions that can also set a thumbnail for the main action. The problem is that the bitmap has a null and bitmap that is not displayed (a text video name is displayed). What is the problem? Can't I figure it out? Plz help me? My code is below. thanks in advance.
if (f.isFile()) { if (fName.endsWith(".mpg") || fName.endsWith(".mov") || fName.endsWith(".wmv") || fName.endsWith(".rm") || fName.endsWith(".mp4")) { tv.setText(fName); path = f.getAbsolutePath(); System.out.println("Video file path=>"+path); thumb = ThumbnailUtils.createVideoThumbnail(f.getAbsolutePath(),MediaStore.Video.Thumbnails.MICRO_KIND); if(thumb==null) { /**Every time it printing null**/ System.out.println("Thumb is null"); } iv.setImageBitmap(thumb);
source share