Ver código fonte

Rotate for wrong orientation image

Hau Vo 7 anos atrás
pai
commit
510a92c923

+ 2
- 2
android/src/main/java/com/reactlibrary/RNThumbnailModule.java Ver arquivo

@@ -42,8 +42,8 @@ public class RNThumbnailModule extends ReactContextBaseJavaModule {
42 42
     filePath = filePath.replace("file://","");
43 43
     MediaMetadataRetriever retriever = new MediaMetadataRetriever();
44 44
     retriever.setDataSource(filePath);
45
-    int videoWidth = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH);
46
-    int videoHeight = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT);
45
+    int videoWidth = Integer.parseInt(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH));
46
+    int videoHeight = Integer.parseInt(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT));
47 47
 
48 48
     Bitmap image = retriever.getFrameAtTime(1000000, MediaMetadataRetriever.OPTION_CLOSEST_SYNC);
49 49