question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Video URI on Android incorrect [🐛]

See original GitHub issue

Description

When picking a video file from an Android device, the URI returned doesn’t work, when I visit the returned URI in Chrome, it says file does not exist. Works fine on iOS

Sample response from the launchImageLibrary: {"fileName": "90510942_824331778088534_328930688839450624_n.mp4", "fileSize": 320924, "uri": "content://com.google.android.apps.photos.contentprovider/-1/2/content%3A%2F%2Fmedia%2Fexternal%2Fvideo%2Fmedia%2F48/ORIGINAL/NONE/2051731147"}

How to repeat issue and example

  • step to reproduce the issue

Solution

What needs to be done to address this issue?

Additional Information

  • Image Picker version: ^3.1.1
  • React Native version: ^0.61.5
  • Platform: Android
  • Development Operating System: macOS
  • Dev tools: Android Studio

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:16
  • Comments:26 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
Janak-Nirmalcommented, Jan 12, 2021

Any solution for this ?

7reactions
sekizlipenguencommented, Jan 17, 2021

Any solution for this ?

I applied a temporary solution;

yarn add react-native-fs

import RNFS from 'react-native-fs';

async videoUrlCopy(uri, fileName) {
        const destPath = `${RNFS.TemporaryDirectoryPath}/${fileName}`;
        await RNFS.copyFile(uri, destPath);
        await RNFS.stat(destPath);
        return destPath;
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Video Cannot Play: Invalid URL Error - Android Central Forums
In the phone, when the video file is attempted to be played, an error message saying "Invalid URL" will appear. The file sizes...
Read more >
"Can't play this video" Error using URL with VideoView and ...
Just an example of a locally stored video playing in Android Studio with VideoView... that doesn't work when applied to online URLs. android...
Read more >
Why video URI is giving Invalid column? - CommonsWare
The error suggests that Samsung is trying to treat a MIME type ( vnd.android.cursor.dir/video ) as the name of a column. You might...
Read more >
163351 - HTML5 Video media fragment URI wrong behaviour
Using of this feature also breaks current (ios safari like) Android Chrome approach : not to preload video file before user interaction (it ......
Read more >
VideoView - Android Developers
Displays a video file. ... Sets video URI using specific headers. ... or null if the ID is invalid (< 0) or there...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found