video thumbnails, which can be implemented via interface class Mediametadataretriever
Specifically, you can see the code snippet
Public Bitmap Getvideothumbnail (String filePath) {Bitmap Bitmap = null; Mediametadataretriever retriever = new Mediametadataretriever (); try {retriever.setdatasource (filePath); bitmap = Retriever.getframeattime ();} catch (IllegalArgumentException e) {e.printstacktrace ();} catch (RuntimeException e) {e.printstacktrace ();} finally { try {retriever.release ();} catch (RuntimeException e) {e.printstacktrace ();}} return bitmap;}
Where the function getframeattime () has other overloaded functions, the function randomly selects a frame crawl, if you want to specify a specific time thumbnail, you can use the function getframeattime (long Timeus), Getframeattime (long Timeus, int option), how to use can check doc.
Android gets video thumbnail