All Products
Search
Document Center

Live-to-VOD

Last Updated: Jan 04, 2021

This topic provides examples on how to use the API operations of the live-to-VOD module. The API operations are encapsulated in ApsaraVideo VOD SDK for Node.js. You can call the API operations to query live-to-VOD videos.

Initialize a client

Before you can use the SDK, initialize a client. For more information, see Initialization.

Query live-to-VOD videos

You can call the ListLiveRecordVideo operation to query live-to-VOD videos.

For more information about the request and response parameters of this operation, see ListLiveRecordVideo. Example:

// Call example
var client = initVodClient('<Your AccessKeyId>','<Your AccessKeySecret>');

client.request("ListLiveRecordVideo", {
    StartTime: '2018-10-18T14:01:57Z',
    EndTime: '2018-10-20T14:01:57Z',
    StreamName: 'testStreamName',
    DomainName: 'testdomain.aliyun.com',
    AppName: 'AppName'
}, {}).then(function (response) {
    if (response.LiveRecordVideoList && response.LiveRecordVideoList.LiveRecordVideo){
        console.log('LiveRecordVideoList.size = ' + response.LiveRecordVideoList.LiveRecordVideo.length);
    }
    console.log('RequestId = ' + response.RequestId);
}).catch(function (response) {
    console.log('ErrorCode = ' + response.data.Code);
    console.log('ErrorMessage = ' + response.data.Message);
    console.log('RequestId = ' + response.data.RequestId);
});