播放完后停在第一帧(缺少大小+再次播放逻辑)
This commit is contained in:
@@ -28,6 +28,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.microedition.khronos.egl.EGL10;
|
||||
import javax.microedition.khronos.egl.EGLConfig;
|
||||
@@ -645,7 +646,12 @@ public class BitmapHelper {
|
||||
Bitmap b = null;
|
||||
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
|
||||
try {
|
||||
retriever.setDataSource( filePath );
|
||||
retriever = new MediaMetadataRetriever();
|
||||
if (Build.VERSION.SDK_INT >= 14)
|
||||
retriever.setDataSource(filePath, new HashMap<String, String>());
|
||||
else
|
||||
retriever.setDataSource(filePath);
|
||||
// mediaMetadataRetriever.setDataSource(videoPath);
|
||||
b = retriever.getFrameAtTime();
|
||||
} catch ( IllegalArgumentException e ) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user