Video doesn't work with new cameraRoll uri path with prefix "ph://" on iOS RN 0.59.5
See original GitHub issueCurrent behavior
video playback doesn’t work with RN 0.59.5 with new cameraRoll URI format using prefix “ph://” on iOS
Reproduction steps
get videos from cameraRoll on iOS and use the URI path with prefix “ph://”
Expected behavior
Video should play
Platform
Which player are you experiencing the problem on: iOS
Details: With RN 0.58.6 cameraRoll returned videos in this format for example:
{ node:
{ timestamp: 1515357324,
location:
{ altitude: 0,
heading: -1,
speed: -1 },
group_name: 'Camera Roll',
type: 'ALAssetTypeVideo',
image:
{ width: 720,
height: 1280,
isStored: true,
filename: 'IMG_0013.mp4',
uri: 'assets-library://asset/asset.mp4?id=D34D1148-2CC7-4AE9-BB2E-67ACBCB60A10&ext=mp4',
playableDuration: 10 } } }
Passing the ‘asset-library’ URI to react-native-video v4.4.0 worked.
However in React Native v0.59.x the cameraRoll API returns videos in the format:
node:
{ timestamp: 1554232151,
type: 'video',
group_name: 'Camera Roll',
location: {},
image:
{ width: 1080,
uri: 'ph://D916EEFD-317B-403D-B589-B3ED9B17E784/L0/001',
height: 1920,
isStored: true,
playableDuration: 4.365 } } }
react-native-video does not work with the new URI format.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:17 (1 by maintainers)
Top Results From Across the Web
Video doesn't work with new cameraRoll uri path with prefix ...
Current behavior video playback doesn't work with RN 0.59.5 with new cameraRoll URI format using prefix "ph://" on iOS Reproduction steps ...
Read more >react native - Camera Roll returned uri does not have file's ...
I have a work around, the returned extension is not pretty but it is useable: From the file RNCCameraRollManager.m: Please add these 2...
Read more >Camera-roll | npm.io
Simple expo camera example with camera functionality separated from overlay styles. expocamerareact-nativecamera-rollflipsavecancelvideorecordingzoom. 2.0.0 • ...
Read more >@react-native-camera-roll/camera-roll - npm
On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs) or a local video file URI...
Read more >react-native-video video doesn't work with new cameraRoll uri path ...
video playback doesn't work with RN 0.59.5 with new cameraRoll URI format ... get videos from cameraRoll on iOS and use the URI...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is what I did to get it working
This should get it working until
react-native-video
adds a fixConverting assets from PH:// to assets-library:// seems to work if the file is local, but in instances where you fetch ‘All’ from CameraRoll you can at times find a video that is stored on iCloud. Trying to load these videos will not load (onLoad) and does not throw an error (onError).
I’m setting up a timeout to notify users if the file does not load right away (not local file) but has anyone uncovered a way to load iCloud assets into react-native-video?