Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Cfirote's avatar
Cfirote
Explorer
7 years ago

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

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

Replies have been turned off for this discussion
  • 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

  • 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 :)