expo icon indicating copy to clipboard operation
expo copied to clipboard

[MediaLibrary] getAssetInfoAsync call not return localUri for video on android 12

Open superyarik opened this issue 3 years ago • 3 comments

Summary

calling MediaLibrary.getAssetsAsync and after that for each item calling MediaLibrary.getAssetInfoAsync. there is no localUri for video items like described in docs

image

What platform(s) does this occur on?

Android

Environment

expo-env-info 1.0.5 environment info: System: OS: macOS 12.2.1 Shell: 5.8 - /usr/local/bin/zsh Binaries: Node: 14.18.0 - /usr/local/opt/node@14/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.15 - /usr/local/opt/node@14/bin/npm Watchman: 2021.10.04.00 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8309675 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild npmPackages: babel-preset-expo: ~9.1.0 => 9.1.0 expo: ^45.0.0 => 45.0.4 react: 17.0.2 => 17.0.2 react-native: 0.68.2 => 0.68.2 react-navigation: 4.4.4 => 4.4.4 npmGlobalPackages: eas-cli: 0.52.0 expo-cli: 5.4.6 Expo Workflow: managed

Minimal reproducible example

https://snack.expo.dev/@hubex_developers/medialibrary-example

just create video in phone galery and run this snack. you can see that video objects has no localUri property

{mediaType:"photo",localUri:"file:///storage/emulated/0/DCIM/Camera/20220910_173415.jpg",location:{…},modificationTime:1662820457000,height:3000,uri:"file:///storage/emulated/0/DCIM/Camera/20220910_173415.jpg",albumId:"-1739773001",filename:"20220910_173415.jpg",width:4000,id:"2503",creationTime:1662820455000,exif:{…},duration:0} ►{mediaType:"video",modificationTime:1662992897000,uri:"file:///storage/emulated/0/DCIM/Camera/20220912_172812.mp4",filename:"20220912_172812.mp4",width:2160,id:"2534",creationTime:1662992897000,albumId:"-1739773001",height:3840,duration:3.8}

superyarik avatar Sep 12 '22 16:09 superyarik

Thank you for filing this issue! This comment acknowledges we believe this may be a bug and there’s enough information to investigate it. However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.

expo-bot avatar Sep 12 '22 18:09 expo-bot

@superyarik thanks for the detailed information and reproduction! I've been able to see the same issue on Android 13. As a workaround, it looks like uri returns the correct value for photos and videos, so you could use that in the meantime.

keith-kurak avatar Sep 12 '22 18:09 keith-kurak

Hi @keith-kurak , on iOS, we are blocked by this issue, on Android this issue can be resolved using your method but on iOS we get phAsset URI in URI and that doesn't allow us to upload the video. I am badly stuck due to this issue as there is no other way except localUri to upload video on iOS. Kindly help at your earliest. CC: @brentvatne @lukmccall @ajsmth

pramancodes avatar Sep 17 '22 04:09 pramancodes

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] avatar Dec 18 '22 17:12 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

github-actions[bot] avatar Dec 25 '22 17:12 github-actions[bot]

This issue still persists in expo SDK 47 (haven't tried with later versions yet). Is it resolved? any updates?

pramancodes avatar Sep 02 '23 17:09 pramancodes