全部产品
云市场

直播转点播

更新时间:2019-01-24 12:38:25

初始化客户端

使用前请先初始化客户端,参考 InitVodClient 接口。

查询直转点视频列表

接口参数和返回字段请参考 ListLiveRecordVideo

  1. using System;
  2. using Aliyun.Acs.Core;
  3. using Aliyun.Acs.Core.Exceptions;
  4. using Aliyun.Acs.vod.Model.V20170321;
  5. namespace Aliyun.Acs.vod.Sdk.ListLiveRecordVideo
  6. {
  7. class MainClass
  8. {
  9. public static void Main(string[] args)
  10. {
  11. try
  12. {
  13. // 构造请求
  14. ListLiveRecordVideoRequest request = new ListLiveRecordVideoRequest();
  15. request.StartTime = "2018-04-24T03:21:04Z";
  16. request.EndTime = "2018-05-21T03:21:44Z";
  17. request.StreamName = "testStreamName";
  18. request.DomainName = "testdomain.aliyun.com";
  19. request.AppName = "testAppName";
  20. // 初始化客户端
  21. DefaultAcsClient client = InitVodClient("<Your AccessKeyId>", "<Your AccessKeySecret>");
  22. // 发起请求,并得到 response
  23. ListLiveRecordVideoResponse response = client.GetAcsResponse(request);
  24. // 打印本次请求ID
  25. Console.WriteLine("RequestId = " + response.RequestId);
  26. if (response.LiveRecordVideoList != null && response.LiveRecordVideoList.Count > 0)
  27. {
  28. //打印查询出来的列表个数
  29. Console.WriteLine("Total = " + response.Total);
  30. foreach (var liveRecordVideo in response.LiveRecordVideoList)
  31. {
  32. Console.WriteLine("AppName = " + liveRecordVideo.AppName);
  33. Console.WriteLine("DomainName = " + liveRecordVideo.DomainName);
  34. Console.WriteLine("PlaylistId = " + liveRecordVideo.PlaylistId);
  35. }
  36. }
  37. }
  38. catch (ServerException e)
  39. {
  40. if (e.RequestId != null)
  41. {
  42. Console.WriteLine("RequestId = " + e.RequestId);
  43. }
  44. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  45. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  46. }
  47. catch (ClientException e)
  48. {
  49. if (e.RequestId != null)
  50. {
  51. Console.WriteLine("RequestId = " + e.RequestId);
  52. }
  53. Console.WriteLine("ErrorCode = " + e.ErrorCode);
  54. Console.WriteLine("ErrorMessage = " + e.ErrorMessage);
  55. }
  56. catch (Exception e)
  57. {
  58. Console.WriteLine("ErrorMessage = " + e.ToString());
  59. }
  60. }
  61. }
  62. }