Adds an episode to an episode list.

Usage notes

Before you call this operation, you must create a production studio instance in the latest playlist mode and add media resources to the instance. For information about how to create a production studio instance by calling an operation, see CreateCaster.

Notice
  • When you select media resources from ApsaraVideo VOD, we recommend that you select resources that are stored in hosted Object Storage Service (OSS) buckets. Resources stored in custom OSS buckets have a validity period. Pay attention to the validity when you select resources that are stored in custom OSS buckets.
  • When you add media resources to your production studio instance, we recommend that you select resources from ApsaraVideo Live and ApsaraVideo VOD. If you add a third-party stream by specifying a streaming URL, the stream may fail to be played. You must pay attention to the quality and validity of third-party streams.

QPS limit

You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limit on an API operation in ApsaraVideo Live.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AddShowIntoShowList

The operation that you want to perform. Set the value to AddShowIntoShowList.

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

The ID of the production studio instance.

  • If the instance was created by calling the CreateCaster operation, check the value of the response parameter CasterId to obtain the instance ID.
  • If the instance was created in the ApsaraVideo Live console, obtain the instance ID on the Production Studio Management page. To go to the page, log on to the ApsaraVideo Live console and click Production Studios in the left-side navigation pane.
Note The value displayed in the Name column for an instance on the Production Studio Management page is the ID of the instance.
ResourceType String Yes vod

The resource type. Valid values:

  • live: live streaming resource
  • vod: on-demand resource
  • pic: image
Note
  • When you select media resources from ApsaraVideo VOD, we recommend that you select resources that are stored in hosted Object Storage Service (OSS) buckets. Resources stored in custom OSS buckets have a validity period. Pay attention to the validity when you select resources that are stored in custom OSS buckets.
  • You can add a media resource from ApsaraVideo Live or by using a third-party URL as a live streaming resource.
  • You can add a media resource from ApsaraVideo VOD or by using a third-party URL or add an image as an on-demand resource.
RegionId String No cn-shanghai

The ID of the region.

ShowName String No liveShow****

The name of the episode.

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

The URL of the resource.

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

The ID of the resource.

Duration Long No 20

The duration of the episode, in seconds.

Note You can specify only one of the RepeatTimes and Duration parameters.
RepeatTimes Integer No 0

The number of times the episode repeats after the first playback is complete. The default value is 0.

Note
  • You can specify only one of the RepeatTimes and Duration parameters.
  • The RepeatTimes parameter specifies the number of repetitions. For example, if you set the value to 0, the episode is to be played once. If you set the value to 1, the episode is to be played twice.
Spot Integer No 1

The position of the episode in the episode list. Position indexes start from 0. By default, the episode is appended to the episode list.

Response parameters

Parameter Type Example Description
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

The ID of the request.

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

The ID of the episode.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=AddShowIntoShowList
&CasterId=LIVEPRODUCER_POST-cn-0pp1czt****
&ResourceType=vod
&<Common request parameters>

Sample success responses

XML format

<AddShowIntoShowListResponse>
  <RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CD8</RequestId>
  <ShowId>a2b8e671-2fe5-4642-a2ec-bf93880e****</ShowId>
</AddShowIntoShowListResponse>

JSON format

{"RequestId":"16A96B9A-F203-4EC5-8E43-CB92E68F4CD8","ShowId":"a2b8e671-2fe5-4642-a2ec-bf93880e****"}

Error codes

For a list of error codes, visit the API Error Center.

Sample code


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 addShowIntoShowList(DefaultAcsClient client, String showName, String resourceId, String resourceUrl,
                                                      String resourceType, Integer spot, Integer repeatTimes,
                                                      String casterId, Long duration) throws ClientException {
        CommonRequest addShowIntoShowListRequest = new CommonRequest();
        addShowIntoShowListRequest.setSysDomain("live.aliyuncs.com");
        addShowIntoShowListRequest.setSysVersion("2016-11-01");
        addShowIntoShowListRequest.setSysAction("AddShowIntoShowList");


  
        if (casterId == null || resourceType == null) {
            return null;
        }
        if (resourceId == null && resourceUrl == null) {
            return null;
        }
        addShowIntoShowListRequest.putQueryParameter("CasterId", casterId);
        addShowIntoShowListRequest.putQueryParameter("ResourceType", resourceType);
        if (showName != null) {
            addShowIntoShowListRequest.putQueryParameter("ShowName", showName);
        }
        if (resourceUrl != null) {
            addShowIntoShowListRequest.putQueryParameter("ResourceUrl", resourceUrl);
        }
        if (resourceId != null) {
            addShowIntoShowListRequest.putQueryParameter("ResourceId", resourceId);
        }
        if (spot != null) {
            addShowIntoShowListRequest.putQueryParameter("Spot", spot.toString());
        }
        if (repeatTimes != null) {
            addShowIntoShowListRequest.putQueryParameter("RepeatTimes", repeatTimes.toString());
        }
        if (duration != null) {
            addShowIntoShowListRequest.putQueryParameter("Duration", duration.toString());
        }
        CommonResponse addShowIntoShowListResponse = client.getCommonResponse(addShowIntoShowListRequest);
        return addShowIntoShowListResponse;
    }


    public void addshows() throws ClientException {
        DefaultAcsClient client = initClient(ACCESS_KEY_ID, ACCESS_KEY_SECRET);
        String[] resourceIds = new String[]{"698d2b23581f476ea71107703e647d1e", "9c97e83e211a435b9f797e4e20eeea27", "76c6addaa41c438985666a8a964fa5e5"};
        for (int i = 0; i < resourceIds.length; i++) {
            String showName = "ShowName#" + i;
            Integer repeatTimes = i;
            addShowIntoShowList(client, showName, resourceIds[i], null, "vod", null, repeatTimes, testCasterId, null);
        }
    }