react-native-video-trim 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -69,7 +69,7 @@ public class VideoTrimmerUtil {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
public static TrimSession trim(String inputFile, String outputFile, int videoDuration, long startMs, long endMs, final VideoTrimListener callback, float progressUpdateInterval
|
|
72
|
+
public static TrimSession trim(String inputFile, String outputFile, int videoDuration, long startMs, long endMs, final VideoTrimListener callback, float progressUpdateInterval) {
|
|
73
73
|
// Format creation time
|
|
74
74
|
@SuppressLint("SimpleDateFormat") SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
|
|
75
75
|
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
|
@@ -84,10 +84,16 @@ public class VideoTrimmerUtil {
|
|
|
84
84
|
|
|
85
85
|
try {
|
|
86
86
|
// Get rotation metadata from input file
|
|
87
|
-
retriever.
|
|
88
|
-
|
|
89
|
-
int rotation =
|
|
90
|
-
retriever
|
|
87
|
+
MediaMetadataRetriever retriever = MediaMetadataUtil.getMediaMetadataRetriever(inputFile);
|
|
88
|
+
|
|
89
|
+
int rotation = 0;
|
|
90
|
+
if (retriever != null) {
|
|
91
|
+
retriever.setDataSource(inputFile);
|
|
92
|
+
String rotationStr = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION);
|
|
93
|
+
rotation = rotationStr != null ? Integer.parseInt(rotationStr) : 0;
|
|
94
|
+
retriever.release();
|
|
95
|
+
}
|
|
96
|
+
|
|
91
97
|
|
|
92
98
|
extractor = new MediaExtractor();
|
|
93
99
|
extractor.setDataSource(inputFile);
|