Exemplo n.º 1
0
 public Task<string> Play(string file, StreamSource source, int index = 0)
 {
     if (source == StreamSource.torrent)
     {
         if (string.IsNullOrEmpty(file))
         {
             TtvProxy.Log.Write("Не верная ссылка на торрент", TypeMessage.Error);
             throw new Exception("Не верная ссылка на торрент");
         }
         file = new Uri(file).ToString();
     }
     string str1 = string.Format("START {0} {1} ", (object)source.ToString().ToUpper(), (object)file);
     string str2 = source != StreamSource.contentid ? str1 + (object)index + " 0 0 0" : str1 + (object)index;
     this._playdTask = new Task<string>(new Func<string>(this.WaytingPlay));
     this._playdTask.Start();
     this.SendMessage(str2.Replace("CONTENTID", "PID"));
     this.PlayedFile = file;
     return this._playdTask;
 }