Android: สามารถแสดงภาพขนาดย่อของวิดีโอได้หรือไม่?


94

ฉันสร้างแอปพลิเคชั่นบันทึกวิดีโอพร้อมกล่องโต้ตอบห้องสมุด กล่องโต้ตอบไลบรารีจะแสดงรายการวิดีโอที่บันทึกโดยแต่ละรายการประกอบด้วยไอคอนชื่อวิดีโอแท็กและข้อมูลสถานที่ดังต่อไปนี้:

ข้อความแสดงแทน

มีใครทราบบ้างว่าสามารถแทนที่ไอคอนด้วยภาพขนาดย่อของวิดีโอ (การแสดงตัวอย่างเฟรมเดียว) ได้หรือไม่?

ขอบคุณ!


ใครก็ได้คำตอบนี้ [ stackoverflow.com/questions/16190374/…
Make it Simple

คำตอบ:


71

หากคุณใช้ API 2.0 หรือใหม่กว่านี้จะได้ผล

int id = **"The Video's ID"**
ImageView iv = (ImageView ) convertView.findViewById(R.id.imagePreview);
ContentResolver crThumb = getContentResolver();
BitmapFactory.Options options=new BitmapFactory.Options();
options.inSampleSize = 1;
Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id, MediaStore.Video.Thumbnails.MICRO_KIND, options);
iv.setImageBitmap(curThumb);

9
แล้วคืออะไรกันแน่id?
phunehehe

1
คุณสามารถสอบถาม MediaStore สำหรับวิดีโอทางโทรศัพท์ "id" เป็นเพียงส่วนหนึ่งของข้อมูลที่คุณค้นหา ดูข้อมูลเพิ่มเติมเกี่ยวกับ MediaStore ได้ที่developer.android.com/reference/android/provider/…
Greg Zimmers

4
ทุกคนรู้สึกประหลาดใจที่ได้ผลงานนี้ ฉันลองสิ่งนี้ แต่ curThumb กลายเป็นโมฆะ
BlueVoodoo

7
แล้วถ้าวิดีโอจาก URL ล่ะ?
jayellos

โปรดตอบสิ่งนี้ [ stackoverflow.com/questions/16190374/…
Make it Simple

92

หากคุณทำไม่ได้หรือไม่สามารถผ่านเคอร์เซอร์ได้และหากคุณมีเพียงพา ธ หรืออ็อบเจกต์ไฟล์คุณสามารถใช้ได้ตั้งแต่ API ระดับ 8 (2.2) บิตแมปแบบคงที่สาธารณะ createVideoThumbnail (String filePath ชนิด int)

เอกสาร Android

รหัสต่อไปนี้ทำงานได้อย่างสมบูรณ์:

Bitmap bMap = ThumbnailUtils.createVideoThumbnail(file.getAbsolutePath(), MediaStore.Video.Thumbnails.MICRO_KIND);

7
เมื่อฉันพยายามสร้างภาพขนาดย่อฉันได้ค่าว่าง ฉันคิดว่าเส้นทางของฉันอาจจะไม่โอเค? myPath = "/ external / video / media / 14180"
haythem souissi

มันทำงานเหมือนเวทมนตร์ แม้ว่าฉันจะไม่ได้ใช้t have my video ID. For better quality use MediaStore.Video.Thumbnails.FULL_SCREEN_KIND`
Sami Eltamawy

แปลกที่มันใช้ไม่ได้เช่นกัน ;-( มีวิดีโออยู่ในฐานข้อมูลฉันสามารถเรียกชื่อ / ขนาดได้ แต่ไม่ใช่ภาพขนาดย่อ
Thomas Decaux

haythem souussi เพราะนี่ไม่ใช่เส้นทางนี่คือ Uri คุณต้องแปลงเป็นเส้นทาง
Nadir Novruzov

วิธีนี้ใช้ได้ผล แต่ส่งคืนรูปภาพจากส่วนที่ไม่ถูกต้องของวิดีโอ ฉันต้องการเฟรมแรก แต่ได้เวลา 5-6 วินาที? ความคิดใด ๆ ?
speedynomads

39

การใช้คลาส:

import android.provider.MediaStore.Video.Thumbnails;

เราสามารถรับขนาดภาพตัวอย่างสองขนาดจากวิดีโอ:

Thumbnails.MICRO_KIND สำหรับ 96 x 96

Thumbnails.MINI_KIND สำหรับ 512 x 384 พิกเซล

นี่คือตัวอย่างโค้ด:

String filePath = "/sdcard/DCIM/Camera/my_video.mp4"; //change the location of your file!

ImageView imageview_mini = (ImageView)findViewById(R.id.thumbnail_mini);
ImageView imageview_micro = (ImageView)findViewById(R.id.thumbnail_micro);

Bitmap bmThumbnail;

//MICRO_KIND, size: 96 x 96 thumbnail
bmThumbnail = ThumbnailUtils.createVideoThumbnail(filePath, Thumbnails.MICRO_KIND);
imageview_micro.setImageBitmap(bmThumbnail);
     
// MINI_KIND, size: 512 x 384 thumbnail 
bmThumbnail = ThumbnailUtils.createVideoThumbnail(filePath, Thumbnails.MINI_KIND);
imageview_mini.setImageBitmap(bmThumbnail);

หากฉันมีลิงก์แบบนี้สำหรับ filepath จะใช้ไม่ได้เพราะฉันพยายามตั้งค่าเป็น imageview และมันไม่แสดงอะไรเลย ... นี่คือเส้นทางของไฟล์ "http: / /unknown.com/v3- 1aox9d1 .mp4 "เห็นได้ชัดว่าเป็นโดเมนจริง แต่เส้นทางนั้นไม่สามารถใช้ภาพขนาดย่อได้หรือไม่
Lion789

ในการใช้คลาส ThumbnailUtils คุณต้องบันทึกไฟล์ลงในดิสก์โดยใช้วิธีการ: ThumbnailUtils.createVideoThumbnail ()
Jorgesys

ขอบคุณฉันจะรับ filepath ใหม่สำหรับสร้าง thumb ได้อย่างไร
Lion789

ทำไม Dose ไม่ทำงานบน Android 4 ขึ้นไป
Criss

1
สวัสดี Cris ฉันมีอุปกรณ์ 3 เครื่อง 4.1 4.2.2 และ 5.0 และใช้งานได้โดยไม่มีปัญหาโพสต์คำถามพร้อมปัญหาและรหัสของคุณแล้วฉันสามารถช่วยคุณได้
Jorgesys

22

ขณะนี้ฉันใช้รหัสต่อไปนี้:

Bitmap bMap = ThumbnailUtils.createVideoThumbnail(file.getAbsolutePath(), MediaStore.Video.Thumbnails.MICRO_KIND);

แต่ฉันพบทางออกที่ดีกว่าด้วยไลบรารีGlideพร้อมรหัสต่อไปนี้ (นอกจากนี้ยังแคชรูปภาพของคุณและมีประสิทธิภาพที่ดีกว่าวิธีการก่อนหน้านี้)

Glide.with(context)
                .load(uri)
                .placeholder(R.drawable.ic_video_place_holder)
                .into(imageView);

20

ฉันแนะนำให้คุณใช้ห้องสมุดGlideจริงๆ เป็นวิธีที่มีประสิทธิภาพที่สุดในการสร้างและแสดงภาพขนาดย่อของวิดีโอสำหรับไฟล์วิดีโอในเครื่อง

เพียงเพิ่มบรรทัดนี้ในไฟล์ gradle ของคุณ:

compile 'com.github.bumptech.glide:glide:3.7.0'

และมันจะกลายเป็นเรื่องง่ายเหมือน:

String filePath = "/storage/emulated/0/Pictures/example_video.mp4";

Glide  
    .with( context )
    .load( Uri.fromFile( new File( filePath ) ) )
    .into( imageViewGifAsBitmap );

สามารถดูข้อมูลเพิ่มเติมได้ที่นี่: https://futurestud.io/blog/glide-displaying-gifs-and-videos

ไชโย!


4
Glide ใช้งานได้กับวิดีโอในเครื่องเท่านั้นไม่ใช่วิดีโอ Url ไม่มีวิธีง่ายๆสำหรับสิ่งนี้
Lutaaya Huzaifah Idris

อุปกรณ์บางเครื่องไม่แสดงภาพขนาดย่อสำหรับวิดีโอในเครื่อง
Sathish Gadde

7

ลองใช้มันได้ผลสำหรับฉัน

RequestOptions requestOptions = new RequestOptions();
 Glide.with(getContext())
      .load("video_url")
      .apply(requestOptions)
      .thumbnail(Glide.with(getContext()).load("video_url"))
      .into("yourimageview");

6

โซลูชันนี้จะใช้ได้กับ Android เวอร์ชันใดก็ได้ ได้รับการพิสูจน์แล้วว่าทำงานใน 1.5 และ 2.2 นี่ไม่ใช่โซลูชัน "นี่สำหรับ Android 2.0+" อีก ฉันพบสิ่งนี้ผ่านทางหน้าคอลเลกชันกระดานข้อความอีเมลและไม่พบลิงก์ต้นฉบับ เครดิตทั้งหมดไปที่โปสเตอร์ต้นฉบับ

ในแอปของคุณคุณจะใช้สิ่งนี้โดยโทร:

Bitmap bm = getVideoFrame(VideoStringUri);

ที่ไหนสักแห่งในฟังก์ชันของตัวเอง (นอก OnCreate ฯลฯ ) คุณจะต้อง:

private Bitmap getVideoFrame(String uri) {
        MediaMetadataRetriever retriever = new MediaMetadataRetriever();
        try {
            retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY);
            retriever.setDataSource(uri);
            return retriever.captureFrame();
        } catch (IllegalArgumentException ex) {
            ex.printStackTrace();
        } catch (RuntimeException ex) {
            ex.printStackTrace();
        } finally {
            try {
                retriever.release();
            } catch (RuntimeException ex) {
            }
        }
        return null;
    }

ในโฟลเดอร์ src ของคุณคุณต้องมีไดเร็กทอรีย่อยใหม่ของ android / media ซึ่งจะเป็นที่ตั้งของคลาส (คัดลอกมาจากแหล่งที่มาของ android เอง) ซึ่งช่วยให้คุณสามารถใช้ฟังก์ชันนี้ได้ ส่วนนี้ไม่ควรเปลี่ยนเปลี่ยนชื่อหรือวางไว้ที่อื่น MediaMetadataRetriever.java ต้องอยู่ภายใต้ android.media ในโฟลเดอร์ซอร์สของคุณเพื่อให้ทุกอย่างทำงานได้

/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.media;

import java.io.FileDescriptor;
import java.io.FileNotFoundException;
import java.io.IOException;

import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap;
import android.net.Uri;

/**
 * MediaMetadataRetriever class provides a unified interface for retrieving
 * frame and meta data from an input media file. {@hide}
 */
public class MediaMetadataRetriever {
    static {
        System.loadLibrary("media_jni");
        native_init();
    }

    // The field below is accessed by native methods
    private int mNativeContext;

    public MediaMetadataRetriever() {
        native_setup();
    }

    /**
     * Call this method before setDataSource() so that the mode becomes
     * effective for subsequent operations. This method can be called only once
     * at the beginning if the intended mode of operation for a
     * MediaMetadataRetriever object remains the same for its whole lifetime,
     * and thus it is unnecessary to call this method each time setDataSource()
     * is called. If this is not never called (which is allowed), by default the
     * intended mode of operation is to both capture frame and retrieve meta
     * data (i.e., MODE_GET_METADATA_ONLY | MODE_CAPTURE_FRAME_ONLY). Often,
     * this may not be what one wants, since doing this has negative performance
     * impact on execution time of a call to setDataSource(), since both types
     * of operations may be time consuming.
     * 
     * @param mode
     *            The intended mode of operation. Can be any combination of
     *            MODE_GET_METADATA_ONLY and MODE_CAPTURE_FRAME_ONLY: 1.
     *            MODE_GET_METADATA_ONLY & MODE_CAPTURE_FRAME_ONLY: For neither
     *            frame capture nor meta data retrieval 2.
     *            MODE_GET_METADATA_ONLY: For meta data retrieval only 3.
     *            MODE_CAPTURE_FRAME_ONLY: For frame capture only 4.
     *            MODE_GET_METADATA_ONLY | MODE_CAPTURE_FRAME_ONLY: For both
     *            frame capture and meta data retrieval
     */
    public native void setMode(int mode);

    /**
     * @return the current mode of operation. A negative return value indicates
     *         some runtime error has occurred.
     */
    public native int getMode();

    /**
     * Sets the data source (file pathname) to use. Call this method before the
     * rest of the methods in this class. This method may be time-consuming.
     * 
     * @param path
     *            The path of the input media file.
     * @throws IllegalArgumentException
     *             If the path is invalid.
     */
    public native void setDataSource(String path)
            throws IllegalArgumentException;

    /**
     * Sets the data source (FileDescriptor) to use. It is the caller's
     * responsibility to close the file descriptor. It is safe to do so as soon
     * as this call returns. Call this method before the rest of the methods in
     * this class. This method may be time-consuming.
     * 
     * @param fd
     *            the FileDescriptor for the file you want to play
     * @param offset
     *            the offset into the file where the data to be played starts,
     *            in bytes. It must be non-negative
     * @param length
     *            the length in bytes of the data to be played. It must be
     *            non-negative.
     * @throws IllegalArgumentException
     *             if the arguments are invalid
     */
    public native void setDataSource(FileDescriptor fd, long offset, long length)
            throws IllegalArgumentException;

    /**
     * Sets the data source (FileDescriptor) to use. It is the caller's
     * responsibility to close the file descriptor. It is safe to do so as soon
     * as this call returns. Call this method before the rest of the methods in
     * this class. This method may be time-consuming.
     * 
     * @param fd
     *            the FileDescriptor for the file you want to play
     * @throws IllegalArgumentException
     *             if the FileDescriptor is invalid
     */
    public void setDataSource(FileDescriptor fd)
            throws IllegalArgumentException {
        // intentionally less than LONG_MAX
        setDataSource(fd, 0, 0x7ffffffffffffffL);
    }

    /**
     * Sets the data source as a content Uri. Call this method before the rest
     * of the methods in this class. This method may be time-consuming.
     * 
     * @param context
     *            the Context to use when resolving the Uri
     * @param uri
     *            the Content URI of the data you want to play
     * @throws IllegalArgumentException
     *             if the Uri is invalid
     * @throws SecurityException
     *             if the Uri cannot be used due to lack of permission.
     */
    public void setDataSource(Context context, Uri uri)
            throws IllegalArgumentException, SecurityException {
        if (uri == null) {
            throw new IllegalArgumentException();
        }

        String scheme = uri.getScheme();
        if (scheme == null || scheme.equals("file")) {
            setDataSource(uri.getPath());
            return;
        }

        AssetFileDescriptor fd = null;
        try {
            ContentResolver resolver = context.getContentResolver();
            try {
                fd = resolver.openAssetFileDescriptor(uri, "r");
            } catch (FileNotFoundException e) {
                throw new IllegalArgumentException();
            }
            if (fd == null) {
                throw new IllegalArgumentException();
            }
            FileDescriptor descriptor = fd.getFileDescriptor();
            if (!descriptor.valid()) {
                throw new IllegalArgumentException();
            }
            // Note: using getDeclaredLength so that our behavior is the same
            // as previous versions when the content provider is returning
            // a full file.
            if (fd.getDeclaredLength() < 0) {
                setDataSource(descriptor);
            } else {
                setDataSource(descriptor, fd.getStartOffset(),
                        fd.getDeclaredLength());
            }
            return;
        } catch (SecurityException ex) {
        } finally {
            try {
                if (fd != null) {
                    fd.close();
                }
            } catch (IOException ioEx) {
            }
        }
        setDataSource(uri.toString());
    }

    /**
     * Call this method after setDataSource(). This method retrieves the meta
     * data value associated with the keyCode.
     * 
     * The keyCode currently supported is listed below as METADATA_XXX
     * constants. With any other value, it returns a null pointer.
     * 
     * @param keyCode
     *            One of the constants listed below at the end of the class.
     * @return The meta data value associate with the given keyCode on success;
     *         null on failure.
     */
    public native String extractMetadata(int keyCode);

    /**
     * Call this method after setDataSource(). This method finds a
     * representative frame if successful and returns it as a bitmap. This is
     * useful for generating a thumbnail for an input media source.
     * 
     * @return A Bitmap containing a representative video frame, which can be
     *         null, if such a frame cannot be retrieved.
     */
    public native Bitmap captureFrame();

    /**
     * Call this method after setDataSource(). This method finds the optional
     * graphic or album art associated (embedded or external url linked) the
     * related data source.
     * 
     * @return null if no such graphic is found.
     */
    public native byte[] extractAlbumArt();

    /**
     * Call it when one is done with the object. This method releases the memory
     * allocated internally.
     */
    public native void release();

    private native void native_setup();

    private static native void native_init();

    private native final void native_finalize();

    @Override
    protected void finalize() throws Throwable {
        try {
            native_finalize();
        } finally {
            super.finalize();
        }
    }

    public static final int MODE_GET_METADATA_ONLY = 0x01;
    public static final int MODE_CAPTURE_FRAME_ONLY = 0x02;

    /*
     * Do not change these values without updating their counterparts in
     * include/media/mediametadataretriever.h!
     */
    public static final int METADATA_KEY_CD_TRACK_NUMBER = 0;
    public static final int METADATA_KEY_ALBUM = 1;
    public static final int METADATA_KEY_ARTIST = 2;
    public static final int METADATA_KEY_AUTHOR = 3;
    public static final int METADATA_KEY_COMPOSER = 4;
    public static final int METADATA_KEY_DATE = 5;
    public static final int METADATA_KEY_GENRE = 6;
    public static final int METADATA_KEY_TITLE = 7;
    public static final int METADATA_KEY_YEAR = 8;
    public static final int METADATA_KEY_DURATION = 9;
    public static final int METADATA_KEY_NUM_TRACKS = 10;
    public static final int METADATA_KEY_IS_DRM_CRIPPLED = 11;
    public static final int METADATA_KEY_CODEC = 12;
    public static final int METADATA_KEY_RATING = 13;
    public static final int METADATA_KEY_COMMENT = 14;
    public static final int METADATA_KEY_COPYRIGHT = 15;
    public static final int METADATA_KEY_BIT_RATE = 16;
    public static final int METADATA_KEY_FRAME_RATE = 17;
    public static final int METADATA_KEY_VIDEO_FORMAT = 18;
    public static final int METADATA_KEY_VIDEO_HEIGHT = 19;
    public static final int METADATA_KEY_VIDEO_WIDTH = 20;
    public static final int METADATA_KEY_WRITER = 21;
    public static final int METADATA_KEY_MIMETYPE = 22;
    public static final int METADATA_KEY_DISCNUMBER = 23;
    public static final int METADATA_KEY_ALBUMARTIST = 24;
    // Add more here...
}

สิ่งนี้ไม่ได้ผลสำหรับฉัน .. เกิดข้อผิดพลาดที่ System.loadLibrary ("media_jni");
DArkO

1
ฉันสามารถยืนยันได้ว่าสิ่งนี้ไม่ได้ผล ฉันต้องการความสามารถนี้เช่นกัน มันจะไม่ทำงานเนื่องจากใช้การเรียกระบบดั้งเดิมที่แอปพลิเคชันทั่วไปไม่มีสิทธิ์ใช้งาน
Andy

MediaMetadataRetrieverได้รับการสนับสนุนจาก API ระดับ 10
Asahi

MediaMetadataRetriever เป็นบล็อกรหัสที่สอง ปัจจุบันอนุญาตให้ API ก่อน 10 (ซึ่งไม่พร้อมใช้งานในขณะที่เขียน) เพื่อเข้าถึงรหัสจากแอปพลิเคชันแทนระบบ การเรียกระบบดั้งเดิมเป็นไปได้ แต่คุณจะต้องมีความเข้าใจคร่าวๆเกี่ยวกับระบบเพื่อใช้งาน ดูเหมือนว่าปัญหาส่วนใหญ่จะใช้แหล่งที่มาที่ให้มาอย่างไม่เหมาะสม
รถเข็นที่ถูกทิ้ง

@LoungeKatt เป็นไปได้ไหมที่ปล่อยให้มันจับภาพวิดีโอเดียวกันจากหลาย ๆ ครั้ง
นักพัฒนา Android

5

Android 1.5 และ 1.6 ไม่มีภาพขนาดย่อนี้ แต่ 2.0 มีดังที่เห็นในบันทึกประจำรุ่นอย่างเป็นทางการ :

สื่อ

  • ขณะนี้ MediaScanner สร้างภาพขนาดย่อสำหรับภาพทั้งหมดเมื่อใส่ลงใน MediaStore
  • Thumbnail API ใหม่สำหรับดึงภาพและวิดีโอขนาดย่อตามต้องการ

3

ฉันกำลังตอบคำถามนี้ช้า แต่หวังว่ามันจะช่วยให้ผู้สมัครคนอื่น ๆ ที่ประสบปัญหาเดียวกัน

ฉันใช้สองวิธีในการโหลดภาพขนาดย่อสำหรับรายการวิดีโอวิธีแรกคือ

    Bitmap bmThumbnail;
    bmThumbnail = ThumbnailUtils.createVideoThumbnail(FILE_PATH
                    + videoList.get(position),
            MediaStore.Video.Thumbnails.MINI_KIND);

    if (bmThumbnail != null) {
        Log.d("VideoAdapter","video thumbnail found");
        holder.imgVideo.setImageBitmap(bmThumbnail);
    } else {
        Log.d("VideoAdapter","video thumbnail not found");
    }

มันดูดี แต่มีปัญหากับวิธีแก้ปัญหานี้เพราะเมื่อฉันเลื่อนรายการวิดีโอมันจะค้างไปสักพักเนื่องจากการประมวลผลขนาดใหญ่

ดังนั้นหลังจากนี้ฉันพบโซลูชันอื่นที่ทำงานได้อย่างสมบูรณ์โดยใช้ Glide Library

 Glide
            .with( mContext )
            .load( Uri.fromFile( new File( FILE_PATH+videoList.get(position) ) ) )
            .into( holder.imgVideo );

ฉันแนะนำวิธีแก้ปัญหาในภายหลังสำหรับการแสดงภาพขนาดย่อพร้อมรายการวิดีโอ ขอบคุณ


-4

นี่คือรหัสสำหรับภาพขนาดย่อของวิดีโอสด

public class LoadVideoThumbnail extends AsyncTask<Object, Object, Bitmap>{

        @Override
        protected Bitmap doInBackground(Object... params) {try {

            String mMediaPath = "http://commonsware.com/misc/test2.3gp";
            Log.e("TEST Chirag","<< thumbnail doInBackground"+ mMediaPath);
            FileOutputStream out;
            File land=new File(Environment.getExternalStorageDirectory().getAbsoluteFile()
                            +"/portland.jpg");

                Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(mMediaPath, MediaStore.Video.Thumbnails.MICRO_KIND);
                        ByteArrayOutputStream stream = new ByteArrayOutputStream();
                        bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream);
                        byte[] byteArray = stream.toByteArray();

                        out=new  FileOutputStream(land.getPath());
                        out.write(byteArray);
                        out.close();
                 return bitmap;

            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        return null;
            }
        @Override
        protected void onPostExecute(Bitmap result) {
            // TODO Auto-generated method stub
            super.onPostExecute(result);
            if(result != null){
                 ((ImageView)findViewById(R.id.imageView1)).setImageBitmap(result);
            }
            Log.e("TEST Chirag","====> End");
        }

    }

2
ฉันได้ค่าว่างที่Bitmap bitmap = ThumbnailUtils.createVideoThumbnail(mMediaPath, MediaStore.Video.Thumbnails.MICRO_KIND);หมายเหตุว่าพารามิเตอร์ทั้งหมดถูกตั้งค่า
Chulo

1
ค่า null ที่ Bitmap bitmap = ThumbnailUtils.createVideoThumbnail (mMediaPath, MediaStore.Video.Thumbnails.MICRO_KIND);
ประสาท
โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.