0

I cant seem to get a successful Unity video player URL link to a video file stored on the SD card of an Android device.

I believe this is due to the file path structure. If the video file was stored on a PC it would look something like this: "/users/name/desktop/video.mp4". (this works).

the same structure to the video on an Android device is something like this: "root/SD card/videos/Video.mp4" (this does not work).

I am not too familiar with Android development so I really have no idea how it should be structured and no documentation I have looked at thus far has enlightened me.

The only code I have to show that is relevant to this issue is this

private string[] videoFilePath = new string[4];

private void OnEnable()
        {
            videoFilePath[1] = "/root/SD card/360 Videos/Searching For Caribou Behind the Scenes FINAL_360.mp4";
            videoFilePath[2] = "/root/SD card/360 Videos/Surround Yourself_360.mp4";
            videoFilePath[3] = "/root/SD card/360 Videos/Valley of Bones FINAL_360.mp4";
    }

gameObject.GetComponent<VideoPlayer>().url = videoFilePath[GameObject.Find("video select").GetComponent<VRInteractiveHandler>().listIndexNumber];
Mike
  • 51
  • 1
  • 1
  • 4
  • This is a repost of an Issue I recently posted that was not answered due to me failing to provide any code. I have provided what little code is relevant to this issue, I hope it helps in understanding the issue better. – Mike Jan 13 '18 at 20:01
  • Don't create the-same post twice. Modifying the old post is what you should have done. Also, don't hard-code the paths like that. This is bound to fail on some Android devices. Are the videos distributed with your app? – Programmer Jan 13 '18 at 20:03
  • Do you have `READ_EXTERNAL_STORAGE` permission enabled? – Hamid Yusifli Jan 13 '18 at 20:06

0 Answers0