cancel
Showing results for 
Search instead for 
Did you mean: 

Unity Video Player - How to load a video from Quest filesystem [Solution]

BFGDev
Level 2
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:
    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
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...

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>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
1 REPLY 1

Anonymous
Not applicable
Hey 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