element-x-ada/libraries
Jorge Martin Espinosa adc61b3826
Add media file limit size warning and media quality selection (#5131)
* Add `VideoCompressorPreset` enum

This represents the different compression presets used for processing videos before uploading them

* Add `VideoCompressorHelper` util class to calculate the scaled output size of the video given an input size and its optimal bitrate

Also add `MediaOptimizationConfig` which will be used to decide how to apply compression in `MediaPreProcessor`

* Add `RustMatrixClient.getMaxFileUploadSize()` function and `MaxUploadSizeProvider` so we can import only this functionality into other components

* Try preloading the max file upload size the first time we get network connectivity - it's a best effort

This should help ensure we'll have this value available later, even if we still need to load it asynchronously.

* Split the `compressMedia` preference into `compressImages` and `compressMediaPreset`

* Modify the media processing parts to use the new classes and utils

* Add `MediaOptimizationSelectorPresenter`, which will retrieve the compression values and the max file upload size, also estimating the compressed video file sizes if needed.

* Add a feature flag to allow selecting the media upload quality per upload

* Integrate the previous changes with the attachments preview screen

Add strings from localazy too.

* Adapt the rest of the app calls to upload media to using the media optimization configs

* Allow modifying the default compression values in advanced settings, based on the feature flag value

* Pass the `fileSize` in `MediaUploadInfo` too, to be able to check it against the `maxUploadSize`

* Update screenshots

---------

Co-authored-by: ElementBot <android@element.io>
2025-08-11 17:22:46 +02:00
..
androidutils Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
architecture Force last owner of a room to pass ownership when leaving (#5094) 2025-08-05 17:24:14 +02:00
audio Improve audio focus management (#4707) 2025-05-13 09:54:58 +00:00
core Add catchingExceptions method to replace runCatching (#4797) 2025-06-04 09:02:26 +02:00
cryptography Apply dual licenses: AGPL + Element Commercial to file headers. 2025-01-07 10:05:04 +01:00
dateformatter OptIn to ExperimentalTime for the whole module. 2025-07-02 18:00:25 +02:00
deeplink Apply dual licenses: AGPL + Element Commercial to file headers. 2025-01-07 10:05:04 +01:00
designsystem Rename extension. 2025-08-05 21:11:19 +02:00
di Fix coroutine scope (#4820) 2025-06-04 15:33:51 +00:00
encrypted-db refactor: Migrate SQLCipher Android to new API (#4874) 2025-06-23 09:29:44 +02:00
eventformatter Sync Strings from Localazy (#4983) 2025-07-04 14:37:59 +00:00
featureflag Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
fullscreenintent Use eventSink instead of lambda in states. 2025-06-10 16:01:45 +02:00
indicator Cleanup testImplementation dependencies (#4790) 2025-06-02 10:51:02 +02:00
maplibre-compose Fix warning about freeCompilerArgs deprecation. 2025-07-02 12:02:44 +02:00
matrix Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
matrixui Force last owner of a room to pass ownership when leaving (#5094) 2025-08-05 17:24:14 +02:00
mediapickers Apply dual licenses: AGPL + Element Commercial to file headers. 2025-01-07 10:05:04 +01:00
mediaplayer Fix coroutine scope (#4820) 2025-06-04 15:33:51 +00:00
mediaupload Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
mediaviewer Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
network Ensure big log does not crash the application 2025-07-08 12:30:17 +02:00
oidc Oidc: Fallback to external browser instead of using Webview (#4808) 2025-06-04 14:25:18 +00:00
permissions Sync Strings from Localazy (#4983) 2025-07-04 14:37:59 +00:00
preferences Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
previewutils Force last owner of a room to pass ownership when leaving (#5094) 2025-08-05 17:24:14 +02:00
push Sync Strings (#5146) 2025-08-11 12:49:29 +00:00
pushproviders deps (firebase) : bom >= 34.0.0 doesn't have ktx module anymore 2025-07-22 18:23:42 +02:00
pushstore Let element enterprise be able to configure id for mapTiler. (#4446) 2025-03-21 17:06:52 +01:00
qrcode Check homeserver when login using qr code (#4708) 2025-05-15 14:08:05 +02:00
roomselect [a11y] Ensure that heading() is applied to all screen titles. 2025-07-04 12:15:42 +02:00
rustsdk
session-storage Fix coroutine scope (#4820) 2025-06-04 15:33:51 +00:00
testtags Remove ExperimentalComposeUiApi. Not necessary anymore. 2025-06-11 17:49:11 +02:00
textcomposer Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
troubleshoot Sync Strings from Localazy 2025-08-04 00:34:11 +00:00
ui-strings Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
ui-utils Add media file limit size warning and media quality selection (#5131) 2025-08-11 17:22:46 +02:00
usersearch Add catchingExceptions method to replace runCatching (#4797) 2025-06-04 09:02:26 +02:00
voiceplayer Fix coroutine scope (#4820) 2025-06-04 15:33:51 +00:00
voicerecorder Fix coroutine scope (#4820) 2025-06-04 15:33:51 +00:00