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.

package main

import (
    "github.com/aliyun/alibaba-cloud-sdk-go/sdk"
    "github.com/aliyun/alibaba-cloud-sdk-go/services/vod"
    "github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
    "fmt"
)

func MyListLiveRecordVideo(client *vod.Client) (response *vod.ListLiveRecordVideoResponse, err error) {
    request := vod.CreateListLiveRecordVideoRequest()
    request.StartTime = "2018-12-01T06:00:00Z"
    request.EndTime = "2018-12-25T06:00:00Z"
    request.StreamName = "testStreamName"
    request.AppName = "testAppName"
    request.PageNo = "1"
    request.PageSize = "10"
    request.SortBy = "CreationTime:Desc"
    request.AcceptFormat = "JSON"

    return client.ListLiveRecordVideo(request)
}

func main() {
    client, err := InitVodClient("<accessKeyId>", "<accessKeySecret>")
    if err ! = nil {
        panic(err)
    }

    response, err := MyListLiveRecordVideo(client)
    if err ! = nil {
        panic(err)
    }

    fmt.Println(response.GetHttpContentString())
    fmt.Println(response.RequestId)
    //videoList := response.LiveRecordVideoList
}