You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/mediaupload/impl/src/main/kotlin/io/element/android/libraries/mediaupload/impl/VideoCompressor.kt
+15-10Lines changed: 15 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,7 @@ class VideoCompressor @Inject constructor(
90
90
val height = it.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)?.toIntOrNull() ?:-1
91
91
val bitrate = it.extractMetadata(MediaMetadataRetriever.METADATA_KEY_BITRATE)?.toLongOrNull() ?:-1
92
92
val framerate = it.extractMetadata(MediaMetadataRetriever.METADATA_KEY_CAPTURE_FRAMERATE)?.toIntOrNull() ?:-1
93
+
val rotation = it.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_ROTATION)?.toIntOrNull() ?:0
93
94
94
95
val (actualWidth, actualHeight) =if (width ==-1|| height ==-1) {
95
96
// Try getting the first frame instead
@@ -103,7 +104,8 @@ class VideoCompressor @Inject constructor(
103
104
width = actualWidth,
104
105
height = actualHeight,
105
106
bitrate = bitrate,
106
-
frameRate = framerate
107
+
frameRate = framerate,
108
+
rotation = rotation,
107
109
)
108
110
}
109
111
}.onFailure {
@@ -113,10 +115,11 @@ class VideoCompressor @Inject constructor(
Copy file name to clipboardExpand all lines: libraries/mediaupload/impl/src/test/kotlin/io/element/android/libraries/mediaupload/impl/VideoStrategyFactoryTest.kt
+24-6Lines changed: 24 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ class VideoStrategyFactoryTest {
39
39
fun`if the video should be compressed and is larger than 720p it will be transcoded`() {
40
40
// Given
41
41
val expectedExtension ="mp4"
42
-
val metadata =VideoFileMetadata(width =1920, height =1080, bitrate =1_000_000, frameRate =50)
0 commit comments