Exemplo n.º 1
0
 private void OnGUI()
 {
     GUI.Label(new Rect(10, 10, Screen.width - 10, 20), "URL: " + url);
     if (ytdlCore.status == ProcessingStatus.READY)
     {
         if (GUI.Button(new Rect(Screen.width / 2 - 75, Screen.height / 2 - 25, 150, 50), "Start Parse"))
         {
             // Start parse
             StartCoroutine(ytdlCore.PrepareAndParse(url));
         }
     }
     else
     {
         if (GUI.Button(new Rect(Screen.width / 2 - 75, Screen.height / 2 - 25, 150, 50), "Status: " + ytdlCore.status))
         {
         }
     }
     if (videoInfo != null)
     {
         string parsedUrl = videoInfo.url;
         if (parsedUrl.Length > 100)
         {
             parsedUrl = parsedUrl.Substring(0, 100) + "...";
         }
         GUI.Label(new Rect(10, 25, Screen.width - 10, 20), "Parsed URL: " + parsedUrl);
     }
     else if (errorMsg != null)
     {
         GUI.Label(new Rect(10, 25, Screen.width - 10, 20), "Parse Error: " + errorMsg);
     }
 }
Exemplo n.º 2
0
        void ParseToPath(string link)
        {
            YTDLCore tempCore = Instantiate(ytdlCore, coreContainer).GetComponent <YTDLCore>();

            tempCore.parseCompleted += ParseCompleted;
            tempCore.errorReceived  += ErrorReceived;
            StartCoroutine(tempCore.PrepareAndParse(link));
        }
Exemplo n.º 3
0
 public void Parse(bool playAfterParse)
 {
     this.playAfterParse = playAfterParse;
     StartCoroutine(ytdlCore.PrepareAndParse(url));
     parseStarted(this);
 }