react-native-video-trim 3.0.0 → 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.
@@ -83,6 +83,18 @@ public class VideoTrimmerUtil {
83
83
  TrimSession session = new TrimSession(Thread.currentThread());
84
84
 
85
85
  try {
86
+ // Get rotation metadata from input file
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
+
97
+
86
98
  extractor = new MediaExtractor();
87
99
  extractor.setDataSource(inputFile);
88
100
 
@@ -100,6 +112,9 @@ public class VideoTrimmerUtil {
100
112
  extractor.selectTrack(i);
101
113
  }
102
114
 
115
+ // Set rotation metadata on muxer
116
+ muxer.setOrientationHint(rotation);
117
+
103
118
  // Seek to start time
104
119
  long startUs = startMs * 1000; // Convert ms to μs
105
120
  long endUs = endMs * 1000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-video-trim",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Video trimmer for your React Native app",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",