Skip to content

Conversation

@OS-pedrogustavobilro
Copy link

Platforms affected

Android

What does this PR do?

Fixes readAsArrayBuffer when reading files from external storage (e.g. videos recorded from Camera Plugin with saveToGallery=true).

Affects only Android versions >= 13, because the issue was related to requesting READ_EXTERNAL_STORAGE, which shouldn't be required for media files, and READ_EXTERNAL_STORAGE is never granted for apps above Android 12.

Also fixed another issue where local files would only be read if file:// was in the uri.

References: https://outsystemsrd.atlassian.net/browse/RMET-4021

What testing has been done on this change?

  • Use a Test App that integrates Outsystems Camera Plugin's RecordVideo and File Plugin's GetFileDataFromUri (which calls readAsArrayBuffer), on devices both above Android 13 and below it. Should be able to read video files on any Android version now.
  • Testing on Outsystems File Sample App to confirm nothing was broken.

For media files, the permission request is only needed for Android 12 and below, will not be granted above Android 12 even with requestLegacyExternalStorage = true.

References: https://outsystemsrd.atlassian.net/browse/RMET-4021
@OS-pedrogustavobilro OS-pedrogustavobilro merged commit 3b134d3 into outsystems Jan 27, 2025
2 checks passed
@OS-pedrogustavobilro OS-pedrogustavobilro deleted the fix/RMET-4021/readAsArrayBuffer branch January 27, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants