public static void getVideoThumbnail ( String videoPath , final VideoThumbnailCallback cb ) { new AsyncTask < String , Void , Bitmap > ( ) { @ Override protected Bitmap doInBackground ( String ... params ) { if ( params . length > 0 ) { String path = params [ 0 ] ; if ( ! TextUtils . isEmpty ( path ) ) { return getVideoThumbnail ( path ) ; } } return null ; } @ Override protected void onPostExecute ( Bitmap bitmap ) { cb . onThumbnail ( bitmap ) ; } } . execute ( videoPath ) ; }
Get the thumbnail of a video asynchronously