public async Task VideoStreamingAsync(string strId, string strToken, Action <StreamingResponse> action) { try { string url = GetUrlStreaming(strId, strToken); string strResBody = String.Empty; StreamingResponse streamingResponse = null; HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); //client.Timeout = TimeSpan.FromMilliseconds(Timeout.Infinite); Stream stream = await client.GetStreamAsync(url); StreamReader reader = new StreamReader(stream); while (!reader.EndOfStream) { strResBody = Utilis.ConvertToUnicode(reader.ReadLine()); if (strResBody.Contains("no_data") || strResBody.Contains("has_emoji")) { LiveVideoDataResp objVideoInfo = await GetStatusLiveVideo(strId, strToken); if (objVideoInfo == null || !objVideoInfo.Status.Equals("LIVE")) { break; } continue; } streamingResponse = JsonConvert.DeserializeObject <StreamingResponse>(strResBody); action(streamingResponse); } } catch (HttpRequestException ex) { throw ex; } catch (Exception ex) { throw ex; } }