cancel
Showing results forΒ 
Search instead forΒ 
Did you mean:Β 

i can't find OVRManager.runInBackground on the last vesion of Unity/Oculus SDK

Cfirote
Level 3
Hi Dev Friends πŸ™‚

I have an app who need to download content (video) to make them local to play the easyer, but on the initialisation, i can let the headset be in sleepmode and pause it.

I use Unity 2018.2.2f1 (64-bit) and the last Oculus SDK

where could I change the OVRManager.runInBackground value ?

thanks for your answer πŸ™‚


2 REPLIES 2

Cfirote
Level 3
Thanks a lot for this article, it's exactlt what i searching πŸ™‚

it seems to be quite easy to implement.

i'll try it today or tomorrow max.

Regards

Cfirote
Level 3

Hello, it's me again ^^.

I haven't succed to implement the DownloadHelper to my code instead of the regular download i use, and i didn't find any tutorial to help me, so i'll need you if possible to help me ::smile: 

there is the part of my code responsable to download the video.n on my app it's downloading one at a time, and i show the number of file remaining and the purcentage of the curent one by this code :

public IEnumerator Downloads()
    {

        total = local.Count;

        if (total >= 1)
        {
            Update1.SetActive(true);

            for (int i = 0; i < total; i++)
            {
                print("Downloading from the web");
                downURL = "http://Somewhere/" + local;
               
                WWW www = new WWW(downURL);
                StartCoroutine(ShowProgress(www));
                yield return www;

                byte[] videoBytes = www.bytes;
                File.WriteAllBytes(Application.persistentDataPath + local, videoBytes);
            }
        }
}

private IEnumerator ShowProgress(WWW www)
    {
        while (!www.isDone)
        {
            if (telechargement == null)
            {
                telechargement = GameObject.FindGameObjectWithTag("download");
            }
            telechargement.transform.GetChild(0).gameObject.GetComponent<Text>().text = "( " + (down+1) + " / " + total + " )";
            telechargement.transform.GetChild(1).gameObject.GetComponent<Text>().text = Mathf.RoundToInt(www.progress * 100).ToString() + " %";
            yield return new WaitForSeconds(.1f);
        }
        down++;
    }

After include the unityPackage i have try to use this command on the first IEnumerator :

DownloadHelper.StartDownload(downURL, "", local);

and remove this line :
WWW www = new WWW(downURL);
                StartCoroutine(ShowProgress(www));
                yield return www;

                byte[] videoBytes = www.bytes;
                File.WriteAllBytes(Application.persistentDataPath + local, videoBytes);

but I didn't find how to get the ID of the download to follow the progress.


Thanks by advance for your help πŸ™‚