调用DescribeShowList查询节目单。
使用说明
请先添加节目后再调用本接口查询节目单。使用API添加节目,请参见添加一个节目到节目单。
QPS限制
本接口的单用户QPS限制为10次/秒。超过限制,API调用会被限流,这可能会影响您的业务,请合理调用。更多信息,请参见QPS限制。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeShowList |
系统规定参数,取值:DescribeShowList。 |
CasterId | String | 是 | LIVEPRODUCER_POST-cn-0pp1czt**** |
导播台ID。
说明 直播控制台云导播台页面导播台列表中的导播台名称即导播台ID。
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8 |
请求ID。 |
ShowList | String | ShowList[Show1, Show2, Show3...] |
ShowList为播放列表的详细信息。 Show为节目单中的节目详细信息,具体内容,请参见下表Show。 |
名称 |
类型 |
描述 |
示例值 |
---|---|---|---|
ShowId |
String |
节目ID。 |
a2b8e671-2fe5-4642-a2ec-bf93880e**** |
Duration |
String |
单个节目播放时间长度。单位:秒。 |
20 |
RepeatTimes |
Integer |
单个节目播放的循环次数。 RepeatTimes为重复次数,示例:0表示重复0次(实际播放1次),1表示重复1次(实际播放2次),以此类推。 |
5 |
ResourceInfo |
Json |
资源信息。 |
请参见下表ResourceInfo。 |
ShowName |
String |
播放节目名称。 |
liveShow**** |
名称 |
类型 |
描述 |
示例值 |
---|---|---|---|
ResourceType |
String |
资源素材类型。 |
vod |
ResourceUrl |
String |
资源URL |
http://**/atestObject**.m3u8 |
ResourceId |
String |
点播文件ID。 |
a2b8e671-2fe5-4642-a2ec-bf93880e**** |
示例
请求示例
http(s)://live.aliyuncs.com/?Action=DescribeShowList
&CasterId=LIVEPRODUCER_POST-cn-0pp1czt****
&<公共请求参数>
正常返回示例
XML
格式
<DescribeShowListResponse>
<RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
<ShowList>
<Shows>
<ResourceInfo>
<resourceId>a2b8e671-2fe5-4642-a2ec-bf93880e****</resourceId>
<resourceUrl>http://**/atestObject**.m3u8</resourceUrl>
<resourceType>vod</resourceType>
</ResourceInfo>
<ShowId>a2b8e671-2fe5-4642-a2ec-bf93880e****</ShowId>
<Duration>20</Duration>
<RepeatTimes>5</RepeatTimes>
<ShowName>liveShow****</ShowName>
</Shows>
<Shows>
<ResourceInfo>
<resourceId>a2b8e671-2fe5-4642-a2ec-bf93880e****</resourceId>
<resourceUrl>http://**/atestObject**.m3u8</resourceUrl>
<resourceType>pic</resourceType>
</ResourceInfo>
<ShowId>a2b8e671-2fe5-4642-a2ec-bf93880e****</ShowId>
<Duration>26</Duration>
<ShowName>liveShow2****</ShowName>
</Shows>
<CurrentShowId>a2b8e671-2fe5-4642-a2ec-bf93880e****</CurrentShowId>
<TotalShowListRepeatTimes>1</TotalShowListRepeatTimes>
<ShowListRepeatTimes>0</ShowListRepeatTimes>
</ShowList>
</DescribeShowListResponse>
JSON
格式
{
"RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8",
"ShowList": {
"Shows": [
{
"ResourceInfo": {
"resourceId": "a2b8e671-2fe5-4642-a2ec-bf93880e****",
"resourceUrl": "http://**/atestObject**.m3u8",
"resourceType": "vod"
},
"ShowId": "a2b8e671-2fe5-4642-a2ec-bf93880e****",
"Duration": 20,
"RepeatTimes": 5,
"ShowName": "liveShow****"
},
{
"ResourceInfo": {
"resourceId": "a2b8e671-2fe5-4642-a2ec-bf93880e****",
"resourceUrl": "http://**/atestObject**.m3u8",
"resourceType": "pic"
},
"ShowId": "a2b8e671-2fe5-4642-a2ec-bf93880e****",
"Duration": 26,
"ShowName": "liveShow2****"
}
],
"CurrentShowId": "a2b8e671-2fe5-4642-a2ec-bf93880e****",
"TotalShowListRepeatTimes": 1,
"ShowListRepeatTimes": 0
}
}
错误码
访问错误中心查看更多错误码。
代码示例
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);
}
}