文档

节目单查询

更新时间:

调用DescribeShowList查询节目单。

使用说明

请先添加节目后再调用本接口查询节目单。使用API添加节目,请参见添加一个节目到节目单

QPS限制

本接口的单用户QPS限制为10次/秒。超过限制,API调用会被限流,这可能会影响您的业务,请合理调用。更多信息,请参见QPS限制

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称

类型

是否必选

示例值

描述

Action String DescribeShowList

系统规定参数。取值:DescribeShowList

CasterId String LIVEPRODUCER_POST-cn-0pp1czt****

导播台ID。

  • 如果您通过CreateCaster接口创建导播台,请查看CreateCaster接口调用返回的参数CasterId值。
  • 如果您通过直播控制台创建导播台,请通过直播控制台 > 导播台 > 云导播台路径查看导播台名称。
说明 直播控制台云导播台页面导播台列表中的导播台名称即导播台ID。

返回数据

名称

类型

示例值

描述

ShowList String ShowList[Show1, Show2, Show3...]

ShowList为播放列表的详细信息。

Show为节目单中的节目详细信息,具体内容,请参见下表Show

RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

请求ID。

ShowListInfo Object

查询节目单。

HighPriorityShowStartTime String 2021-11-23T12:30:00

最高优先级节目播放时间,格式为:yyyy-MM-dd'T'HH:mm:ss。

说明 此配置只能在节目单未开始启动前设置。配置完成,节目单会在最高优先级播放时间进行切播,开始播放最高优先级节目(从当前正在播放的节目切播到最高级优先节目)。
TotalShowListRepeatTimes Integer 1

整个节目单播放的循环次数。

ShowListRepeatTimes Integer 0

播单默认循环次数。始终为0。

CurrentShowId String a2b8e671-2fe5-4642-a2ec-bf93880e****

当前正在播放的节目ID。

HighPriorityShowId String a2b8e671-2fe5-4642-a2ec-bf93880e****

最高优先级节目。

说明 此配置只能在节目单未开始启动前设置。
ShowList Array of Show

播放列表的详细信息。

Show
ShowName String liveShow****

播放节目名称。

Duration Long 20

单个节目播放时间长度。单位:秒。

RepeatTimes Integer 5

单个节目播放的循环次数。

RepeatTimes为重复次数,示例:0表示重复0次(实际播放1次),1表示重复1次(实际播放2次),以此类推。

ShowId String a2b8e671-2fe5-4642-a2ec-bf93880e****

节目ID。

ResourceInfo Object

资源信息。

LiveInputType Integer 1

自定义的类型标记。

ResourceUrl String http://**/atestObject**.m3u8

资源URL。

ResourceType String vod

资源素材类型。

ResourceId String a2b8e671-2fe5-4642-a2ec-bf93880e****

点播文件ID。

示例

请求示例

http(s)://live.aliyuncs.com/?Action=DescribeShowList
&CasterId=LIVEPRODUCER_POST-cn-0pp1czt****
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeShowListResponse>
    <ShowList>ShowList[Show1, Show2, Show3...]</ShowList>
    <RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
    <ShowListInfo>
        <HighPriorityShowStartTime>2021-11-23T12:30:00</HighPriorityShowStartTime>
        <TotalShowListRepeatTimes>1</TotalShowListRepeatTimes>
        <ShowListRepeatTimes>0</ShowListRepeatTimes>
        <CurrentShowId>a2b8e671-2fe5-4642-a2ec-bf93880e****</CurrentShowId>
        <HighPriorityShowId>a2b8e671-2fe5-4642-a2ec-bf93880e****</HighPriorityShowId>
        <ShowList>
            <ShowName>liveShow****</ShowName>
            <Duration>20</Duration>
            <RepeatTimes>5</RepeatTimes>
            <ShowId>a2b8e671-2fe5-4642-a2ec-bf93880e****</ShowId>
            <ResourceInfo>
                <LiveInputType>1</LiveInputType>
                <ResourceUrl>http://**/atestObject**.m3u8</ResourceUrl>
                <ResourceType>vod</ResourceType>
                <ResourceId>a2b8e671-2fe5-4642-a2ec-bf93880e****</ResourceId>
            </ResourceInfo>
        </ShowList>
    </ShowListInfo>
</DescribeShowListResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "ShowList" : "ShowList[Show1, Show2, Show3...]",
  "RequestId" : "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8",
  "ShowListInfo" : {
    "HighPriorityShowStartTime" : "2021-11-23T12:30:00",
    "TotalShowListRepeatTimes" : 1,
    "ShowListRepeatTimes" : 0,
    "CurrentShowId" : "a2b8e671-2fe5-4642-a2ec-bf93880e****",
    "HighPriorityShowId" : "a2b8e671-2fe5-4642-a2ec-bf93880e****",
    "ShowList" : {
      "ShowName" : "liveShow****",
      "Duration" : 20,
      "RepeatTimes" : 5,
      "ShowId" : "a2b8e671-2fe5-4642-a2ec-bf93880e****",
      "ResourceInfo" : {
        "LiveInputType" : 1,
        "ResourceUrl" : "http://**/atestObject**.m3u8",
        "ResourceType" : "vod",
        "ResourceId" : "a2b8e671-2fe5-4642-a2ec-bf93880e****"
      }
    }
  }
}

错误码

访问错误中心查看更多错误码。

代码示例

 public static DefaultAcsClient initClient(String accessKeyId, String accessKeySecret) throws ClientException {
        String regionId = "cn-shanghai";  
        DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
        DefaultAcsClient client = new DefaultAcsClient(profile);
        return client;
    }
private static CommonResponse describeShowList(DefaultAcsClient client, String casterId) throws ClientException {
        CommonRequest describeShowListRequest = new CommonRequest();
        describeShowListRequest.setSysDomain("live.aliyuncs.com");
        describeShowListRequest.setSysVersion("2016-11-01");
        describeShowListRequest.setSysAction("DescribeShowList");
        if (casterId != null) {
            describeShowListRequest.putQueryParameter("CasterId", casterId);
        }
        CommonResponse describeShowListRequestResponse = client.getCommonResponse(describeShowListRequest);
        System.out.println("查询showList成功,返回值:" + JSON.toJSONString(describeShowListRequestResponse));
        return describeShowListRequestResponse;
    }
public void describeShowList() throws ClientException {
        DefaultAcsClient client = initClient(ACCESS_KEY_ID, ACCESS_KEY_SECRET);
        CommonResponse describeShowListResponse = describeShowList(client, testCasterId);
        String data = describeShowListResponse.getData();
        JSONObject jsonObject = JSON.parseObject(data);
        JSONObject showList = jsonObject.getJSONObject("ShowList");
        JSONArray shows = showList.getJSONArray("Shows");
        //解析节目单信息
        for (int i = 0; i < shows.size(); i++) {
            JSONObject show = (JSONObject) shows.get(i);
            String showId = show.getString("ShowId");
            String resourceType = show.getString("ResourceType");
            String resourceInfo = show.getString("ResourceInfo");
            Integer repeatTimes = show.getInteger("RepeatTimes");
            Long duration = show.getLong("Duration");
            String showInfo = String.format("show%d: showId: %s \n resourceType: %s  \n  resourceInfo: %s \n RepeatTimes: %d \n Duration: %d",
                    i + 1, showId, resourceType, resourceInfo, repeatTimes, duration);
            System.out.println(showInfo);
        }
    }

  • 本页导读 (1)
文档反馈