-
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
Read the video from android asset folder #2825
Comments
try like
|
Thank you for your answer, but please clarify my problem first, my file is not in the top-level directory, but in the compiled asset directory of android. Your answer is for files placed in the top-level directory. |
According java code, it asset:// should be a valid uri to use it. but I didn't find the 'full' implementation (I was expecting specific implementation). According to this: You can also try to use the uri asset:///test.mp4 Please let me know if you find a solution. |
did you try with : assets-library:// ? |
This will need a new loader adding to support loading files from assets. An example of this being done in exoplayer can be seen here We'd essentially want to add a detection for an asset:// type and add a new loader here https://github.com/react-native-video/react-native-video/blob/66b2ba3fcfd4efb7863530da76950ba397ebde85/android/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java#L722 |
@freeboub I tried the way you provided, but unfortunately it doesn't work |
I must to read the video from android asset folder, so using
require
or putting the video inandroid/raw
doesn't suit my needs.I know this issue has been reported, but it doesn't seem to actually fix it. Hope someone can help me, thanks.
Below are the paths I've tried, but unfortunately none of them work.
Related References:
Using file path in react-native-video
Path of Android asset folder
The same issue but he fix it by adjusting source code
Read the video from android raw folder but not my case
The same issue:
#2096, #1826
The text was updated successfully, but these errors were encountered: