Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Bitmap;

import android.media.MediaMetadataRetriever;

public class Main {
    public static Bitmap getVideoScreenShot(String filePath) {
        MediaMetadataRetriever media = new MediaMetadataRetriever();
        media.setDataSource(filePath);
        Bitmap bitmap = media.getFrameAtTime();
        media.release();
        return bitmap;
    }
}