Example usage for android.media ThumbnailUtils createVideoThumbnail

List of usage examples for android.media ThumbnailUtils createVideoThumbnail

Introduction

In this page you can find the example usage for android.media ThumbnailUtils createVideoThumbnail.

Prototype

public static Bitmap createVideoThumbnail(String filePath, int kind) 

Source Link

Document

Create a video thumbnail for a video.

Usage

From source file:Main.java

public static Bitmap getThumb(String filePath, int kind) {
    return ThumbnailUtils.createVideoThumbnail(filePath, kind);
}

From source file:Main.java

public static Bitmap createVideoThumbnail(String vidioPath, int width, int height, int kind) {
    Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(vidioPath, kind);
    bitmap = ThumbnailUtils.extractThumbnail(bitmap, width, height, ThumbnailUtils.OPTIONS_RECYCLE_INPUT);
    return bitmap;
}

From source file:Main.java

public static Bitmap getVideoThumbnail(String path) {
    return ThumbnailUtils.createVideoThumbnail(path, Thumbnails.FULL_SCREEN_KIND);
}

From source file:Main.java

public static Bitmap getVideoThumbnail(String videoPath, int width, int height, int kind) {
    Bitmap bitmap;/*ww  w  .  j  a va 2  s . c  o  m*/
    bitmap = ThumbnailUtils.createVideoThumbnail(videoPath, kind);
    bitmap = ThumbnailUtils.extractThumbnail(bitmap, width, height, ThumbnailUtils.OPTIONS_RECYCLE_INPUT);
    return bitmap;
}

From source file:Main.java

public static Bitmap getVideoThumbnail(String videoPath, int width, int height, int kind) {
    Bitmap bitmap = null;//from   ww w . j  a  v a  2s .  c  o  m
    bitmap = ThumbnailUtils.createVideoThumbnail(videoPath, kind);
    bitmap = ThumbnailUtils.extractThumbnail(bitmap, width, height, ThumbnailUtils.OPTIONS_RECYCLE_INPUT);
    return bitmap;
}

From source file:Main.java

public static Bitmap decodeSampledBitmapFromVideo(String videoPath) {
    Bitmap bmThumbnail = ThumbnailUtils.createVideoThumbnail(videoPath, Thumbnails.MINI_KIND);
    return bmThumbnail;
}

From source file:Main.java

public static Bitmap createThumbnailForVideo(String videoPath) {
    return ThumbnailUtils.createVideoThumbnail(videoPath, MediaStore.Images.Thumbnails.MINI_KIND);
}

From source file:Main.java

public static Bitmap getVideoThumbnail(String filePath, int width, int height, int kind) {
    Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(filePath, kind);
    bitmap = ThumbnailUtils.extractThumbnail(bitmap, width, height, ThumbnailUtils.OPTIONS_RECYCLE_INPUT);
    return bitmap;
}

From source file:Main.java

public static Bitmap getMediaFrame(String filePath) {
    if (TextUtils.isEmpty(filePath)) {
        return null;
    }//from w w  w .  j a  v a  2  s. c o  m
    Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(filePath, MediaStore.Images.Thumbnails.MINI_KIND);

    bitmap = ThumbnailUtils.extractThumbnail(bitmap, 720, 387);
    return bitmap;
}

From source file:Main.java

@SuppressWarnings("finally")
@TargetApi(8)/*from  w w  w.j ava 2  s  .c o  m*/
public static Bitmap createVideoThumbnail(String filePath, final int width, final int height) {
    //return null;
    try {
        Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(filePath, Thumbnails.MINI_KIND);
        if (bitmap == null)
            return null;
        return android.media.ThumbnailUtils.extractThumbnail(bitmap, width, height);
    } catch (NoSuchMethodError e) {
        return null;
    } catch (NoClassDefFoundError e) {
        return null;
    } catch (Exception e) {
        return null;

    } finally {
        return null;
    }

}