全部产品
云市场

直播转点播

更新时间:2018-12-25 15:42:42

初始化客户端

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

查询直转点视频列表

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

  1. import com.aliyuncs.vod.model.v20170321.ListLiveRecordVideoRequest;
  2. import com.aliyuncs.vod.model.v20170321.ListLiveRecordVideoResponse;
  3. /*查询直播转点播视频列表函数*/
  4. public static ListLiveRecordVideoResponse listLiveRecordVideo(DefaultAcsClient client) throws Exception {
  5. ListLiveRecordVideoRequest request = new ListLiveRecordVideoRequest();
  6. request.setStartTime("2018-04-24T03:21:04Z");
  7. request.setEndTime("2018-05-21T03:21:44Z");
  8. request.setStreamName("testStreamName");
  9. request.setDomainName("testdomain.aliyun.com");
  10. request.setAppName("testAppName");
  11. return client.getAcsResponse(request);
  12. }
  13. /*以下为调用示例*/
  14. public static void main(String[] argv) {
  15. DefaultAcsClient client = initVodClient("<您的AccessKeyId>", "<您的AccessKeySecret>");
  16. ListLiveRecordVideoResponse response = new ListLiveRecordVideoResponse();
  17. try {
  18. response = listLiveRecordVideo(client);
  19. //打印查询出来的列表个数
  20. System.out.print("LiveRecordVideoList.size = " + response.getLiveRecordVideoList().size() + "\n");
  21. } catch (Exception e) {
  22. System.out.print("ErrorMessage = " + e.getLocalizedMessage());
  23. }
  24. System.out.print("RequestId = " + response.getRequestId() + "\n");
  25. }