Forum Discussion
BFGDev
6 years agoHonored Guest
Unity Video Player - How to load a video from Quest filesystem [Solution]
I had some trouble getting clarification as to how to do this. Pieces of the answer were available in different discussion threads, so I put it all together here for the next person who gets stuck.
Set the file path for the VideoPlayer source in Unity, like this:
Set the file path for the VideoPlayer source in Unity, like this:
file://mnt/sdcard/<directory_path)>/<video_name.mp4>
You will need to set permission in the AndroidManifest.xml and via adb shell
In your shell app::
1. Check permissions
1. Check permissions
adb shell dumpsys package <package_name>
In the dump you will see "requested permissions", with android.permission.WRITE_EXTERNAL_STORAGE and android.permission.READ_EXTERNAL_STORAGE. These will have no value. You need to look at "runtime permissions"
If it says:
android.permission.WRITE_EXTERNAL_STORAGE: granted=true
android.permission.READ_EXTERNAL_STORAGE: granted=true
You don't need to do anything else in the shell, skip to #4, AndroidManifest
If not...
In the dump you will see "requested permissions", with android.permission.WRITE_EXTERNAL_STORAGE and android.permission.READ_EXTERNAL_STORAGE. These will have no value. You need to look at "runtime permissions"
If it says:
android.permission.WRITE_EXTERNAL_STORAGE: granted=true
android.permission.READ_EXTERNAL_STORAGE: granted=true
You don't need to do anything else in the shell, skip to #4, AndroidManifest
If not...
2. Set new permissions
adb shell pm grant <package_name> android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant <package_name> android.permission.WRITE_EXTERNAL_STORAGE
3. Confirm permissions (check to see that granted=true has been added to the permissions under runtime permissions)
adb shell dumpsys package <package_name>
4. In AndroidManifest.xml, add these lines before <application>
4. In AndroidManifest.xml, add these lines before <application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
1 Reply
- AnonymousHey there, thanks to you, I got a video player working that is playing a video from my custom folder.This works flawlessly on Quest 1 (and Go) but NOT on Quest 2. The player stays black and doesn't load the video.Do you know if Quest 2 has a different local storage path?Thanks for any tip,Felix
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 years ago
- 9 months ago
- 6 months ago
- 10 months ago