Ejemplo n.º 1
0
 public void JoinCall()
 {
     if (Connected == null)
     {
         throw new MissingEventException("Connected");
     }
     else
     {
         //get info
         string data;
         while (true)
         {
             if (Server.CanRequest)
             {
                 using HttpClient web = new();
                 web.DefaultRequestHeaders.Add("token", Server.Token);
                 web.DefaultRequestHeaders.Add("id", Channel.ToString());
                 data = web.GetAsync($"https://{Server.Domain}/Luski/api/{Server.API_Ver}/GetCallInfo").Result.Content.ReadAsStringAsync().Result;
                 break;
             }
         }
         IncomingHTTP json = JsonSerializer.Deserialize <IncomingHTTP>(data);
         call         c    = JsonSerializer.Deserialize <call>(json.data.ToString());
         Server.ServerOut.Send(JsonRequest.Send(DataType.Join_Call, JsonRequest.JoinCall(Channel)).ToString());
         Samples = c.samples;
     }
 }
Ejemplo n.º 2
0
 public void LeaveCall()
 {
     Server.ServerOut.Send(JsonRequest.Send(DataType.Leave_Call, JsonRequest.JoinCall(Channel)).ToString());
     StopRecordingFromSounddevice_Client();
 }