My app can download video content from firebase, save it to the Application.dataPath, and then play it in the editor. However, when I build it to iOS, it does not find the file. I have also tried using Application. persistentData but it does seem to be there. Any helpful pointers?
// _____ forgive my ugly code :/ ______ // ____ i have deleted crappy comments etc, tidied up, but i think this gives an idea of th tricks i'm using ...
public void FUKN_download_viddy()
{
FirebaseStorage storage = FirebaseStorage.DefaultInstance;
StorageReference path_reference = storage.GetReference("videoname.mp4");
pathToSaveTo = "file://" +
Application.dataPath +
"/Resources/Adam/Year 1 Semester 1/"+
"videoname.mp4";
path_reference.GetFileAsync(pathToSaveTo).ContinueWith(task => {
if (!task.IsFaulted && !task.IsCanceled)
{
Debug.Log("File downloaded.");
}
});
}
// ____________
// _________
public void FUKN_play_viddy()
{
string viddyplayerpath = "Adam/Year 1 Semester 1/" + "videofile";
var viddyKlip = Resources.Load<VideoClip>(viddyplayerpath);
VideoPlayer videoPlayer = GetComponent<VideoPlayer>();
videoPlayer.clip = viddyKlip; // index offset
videoPlayer.Play();
}
// _________