-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Playing local files #125
Comments
yes ! |
Try putting your video file in your Android raw sources folder and then using it as |
@isair the requirement is for playback on video found within the external storage directory, not assets compiled with the app. Basically, the functionality should mimic playback like found with the Gallery app. @buhe do you have a working example of playing back an external resource? Additionally, has anyone been able to play locally stored videos on either iOS or Android? |
I figured it out. This function adds the prefix |
Android is ok after comment this , but don't luck at iOS. |
@isair since you've added a good amount of the android support, I was wondering if you have managed to get remote URLs to play? I haven't had any success thus far. Any help would be greatly appreciated. Thanks. |
@hunteredwards you can try my fork to play external storage video. |
When I created Lumpen Radio iOS app using this module a year ago I was able to store local video files under the project root folder in During the Android support addition @isair mentioned video files for Android can be stored under Poking through the open PRs I noticed this promising gem, which appears to allow one to leverage the RN asset system to do the resolving and help prevent by-platform file duplication or any kind of funky "cross-the-streams" loading of files for iOS from the Android raw sources folder. Keywords Related issues |
See #251 for loading local files using RN assets system. |
Has anyone figured out how to load anything from |
@tadeaspetak |
Did anyone resolve issue? |
For anyone stumbling upon this issue while trying to load local videos (i.e. native project assets rather than RN static resources), I have a few tips. In my case, it was a matter of saving precious megabytes for CodePush updates. Indeed, when the videos are part of the RN project's static resources, they will be included in the JS bundle sent to CodePush and retrieved by the users. I'll let you do the calculation, but when you save more than 30 MB per update times 50k users, that counts! Not to mention the enhanced user experience. To do so, you'll first need to add the video files to your project:
Then for the tricky part that cost me a lot of trials and errors:
I didn't find this info anywhere so I thought it could help a frustrated dev or two ;-) |
How we can download file in |
I have tried this:
<Video source={{uri: "/storage/emulated/0/test.mp4" }} ....
to no avail, and I was wondering if anyone has had any success playing local files on Android. If so, I would like to know how or if this is currently only available for iOS.@buhe Is your pull request trying to fix this?
Thanks.
The text was updated successfully, but these errors were encountered: