All Products
Search
Document Center

Live-to-VOD

Last Updated: Jul 11, 2019

Initialize a client

Initialize a client before using the SDK. For more information, see initVodClient.

Query a list of VOD files created from live streams

For more information about the request and response parameters, see ListLiveRecordVideo.

import com.aliyuncs.vod.model.v20170321.ListLiveRecordVideoRequest;
import com.aliyuncs.vod.model.v20170321.ListLiveRecordVideoResponse;

/*Method for querying a list of VOD files created from live streams*/
public static ListLiveRecordVideoResponse listLiveRecordVideo(DefaultAcsClient client) throws Exception {
    ListLiveRecordVideoRequest request = new ListLiveRecordVideoRequest();
    request.setStartTime("2018-04-24T03:21:04Z");
    request.setEndTime("2018-05-21T03:21:44Z");
    request.setStreamName("testStreamName");
    request.setDomainName("testdomain.aliyun.com");
    request.setAppName("testAppName");
    return client.getAcsResponse(request);
}

/*Call example*/
public static void main(String[] argv) {
    DefaultAcsClient client = initVodClient("<Your AccessKey ID>", "<Your AccessKey Secret>");
    ListLiveRecordVideoResponse response = new ListLiveRecordVideoResponse();
    try {
        response = listLiveRecordVideo(client);
        // The number of VOD files that are found.
        System.out.print("LiveRecordVideoList.size = " + response.getLiveRecordVideoList().size() + "\n");
    } catch (Exception e) {
        System.out.print("ErrorMessage = " + e.getLocalizedMessage());
    }
    System.out.print("RequestId = " + response.getRequestId() + "\n");
}