MediaPlayerCtrl.DownloadStreamingVideoAndLoad2 C# (CSharp) Метод

DownloadStreamingVideoAndLoad2() публичный Метод

public DownloadStreamingVideoAndLoad2 ( string strURL ) : IEnumerator
strURL string
Результат IEnumerator
    public IEnumerator DownloadStreamingVideoAndLoad2(string strURL)
    {
        strURL = strURL.Trim();

        string write_path = Application.persistentDataPath + "/Data" + strURL.Substring(strURL.LastIndexOf("/"));

        if (System.IO.File.Exists(write_path) == true)
        {
            Load("file://" + write_path);
        }
        else
        {
            WWW www = new WWW(strURL);

            yield return www;

            if (string.IsNullOrEmpty(www.error))
            {

                if (System.IO.Directory.Exists(Application.persistentDataPath + "/Data") == false)
                    System.IO.Directory.CreateDirectory(Application.persistentDataPath + "/Data");


                System.IO.File.WriteAllBytes(write_path, www.bytes);

                Load("file://" + write_path);
            }
            else
            {
                Debug.Log(www.error);

            }

            www.Dispose();
            www = null;
            Resources.UnloadUnusedAssets();
        }


    }
MediaPlayerCtrl