All Products
Search
Document Center

ApsaraVideo Live:FAQ about stream ingest disabling

Last Updated:Sep 14, 2024

When do I need to disable stream ingest?

If an ingest URL is leaked, the use of the URL to ingest a stream may increase the risk of malicious attacks. In this case, you must disable the ingest URL. ApsaraVideo Live allows you to disable stream ingest to meet your business requirements.

How do I disable stream ingest?

  • Use the ApsaraVideo Live console to disable stream ingest

    • Query an active stream and disable stream ingest

      When a stream is being ingested, you can perform the following steps to query the stream and disable stream ingest: Log on to the ApsaraVideo Live console and click Streams in the left-side navigation pane. On the page that appears, select the domain name and click Search to query the active streams. Find the stream that you want to disable and click Disable in the Actions column.

      002

    • Query a historical stream and disable stream ingest

      After a stream is ingested, you can perform the following steps to query the stream and disable stream ingest: Log on to the ApsaraVideo Live console and click Streams in the left-side navigation pane. On the page that appears, click the Historical Streams tab, select the domain name, and then click Search to query the streams. Find the stream that you want to disable and click Disable in the Actions column.

  • Use an SDK to disable stream ingest

    ApsaraVideo Live provides API operations based on OpenAPI Explorer of Alibaba Cloud. The API operations of ApsaraVideo Live are integrated into different SDKs. Download a server SDK based on your business requirements. For more information, see Server SDKs. For information about how to use the server SDKs, see Use the server SDK for Java.

    The following sample code shows how to use the server SDK for Java to disable stream ingest. To use the server SDK for Java, add the following Maven dependencies to the pom.xml file:

    <dependencies>
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-live</artifactId>
            <version>3.9.0</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-core</artifactId>
            <optional>true</optional>
            <version>2.3.8</version>
        </dependency>
    </dependencies>
                        
    Note

    In the preceding sample code, the version of the SDK is for reference only. For information about how to obtain the latest version of the SDK, see Server SDKs.

    The aliyun-java-sdk-core dependency is the core module that encapsulates Alibaba Cloud APIs and is required for various Alibaba Cloud SDKs for Java. The aliyun-java-sdk-cdn dependency includes the Request and Response classes of ApsaraVideo Live. The Request class for querying the stream ingest blacklist is DescribeLiveStreamsBlockListRequest and the corresponding Response class is DescribeLiveStreamsBlockListResponse, as shown in the following sample code:

    @Test
    public void testDescribeLiveStreamsBlockList() throws Exception {
        DescribeLiveStreamsBlockListResponse res = DescribeLiveStreamsBlockListR();
        System.out.println(res.getStreamUrls());
    }
    
    private DescribeLiveStreamsBlockListResponse DescribeLiveStreamsBlockListR() {
        DescribeLiveStreamsBlockListRequest request = new DescribeLiveStreamsBlockListRequest();
        request.setDomainName("<DomainName>");
        DescribeLiveStreamsBlockListResponse response=null;
        try {
            response = client.getAcsResponse(request);
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        } 
        return response;
    }

    Logic of the sample code

    1. Initialize the Java client.

      The SDK uses IAcsClient to call API operations. When you initialize IAcsClient, set the region, AccessKeyId, and AccessKeySecret parameters based on the IClientProfile object. The region parameter specifies the region where the API server resides. Set this parameter to cn-hangzhou. The AccessKeyId and AccessKeySecret parameters are used for user authentication. You can use the AccessKey ID and AccessKey secret of an Alibaba Cloud account. If you want to use the AccessKey ID and AccessKey secret of a Resource Access Management (RAM) user, make sure that the RAM user is granted the permissions on ApsaraVideo Live.

    2. Initialize the Request class.

      The SDK provides Request and Response classes for each operation. For more information about the request parameters for disabling stream ingest, see ForbidLiveStream.

    3. Initiate a request and obtain the response.

      Call the getAcsResponse method of IAcsClient to initiate a request and instantiate the returned deserialized results to the parameters of the Response class. This method also supports the ServerException and ClientException classes.

      • If an HTTP status code of 3xx or 4xx is returned, the SDK throws ClientException, which indicates a client error.

      • If an HTTP status code of 5xx is returned, the SDK throws ServerException, which indicates a server error.

      • If the SDK does not throw exceptions, the operation is successfully called.

How do I query the stream ingest blacklist?

  • Use the ApsaraVideo Live console to query the blacklist

    After you disable stream ingest for a live stream, you can perform the following steps to query the stream ingest blacklist: Log on to the ApsaraVideo Live console and click Streams in the left-side navigation pane. On the page that appears, select the domain name, click the Disabled Streams tab, and then click Search to query the blacklist.

  • Use an SDK to query the blacklist

    ApsaraVideo Live provides API operations based on OpenAPI Explorer of Alibaba Cloud. The API operations of ApsaraVideo Live are integrated into different SDKs. Download a server SDK based on your business requirements. For more information, see Server SDKs. For information about how to use the server SDKs, see Use the server SDK for Java.

    <dependencies>
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-live</artifactId>
            <version>3.9.0</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-core</artifactId>
            <optional>true</optional>
            <version>2.3.8</version>
        </dependency>
    </dependencies>
    Note

    In the preceding sample code, the version of the SDK is for reference only. For information about how to obtain the latest version of the SDK, see Server SDKs.

    The aliyun-java-sdk-core dependency is the core module that encapsulates Alibaba Cloud APIs and is required for various Alibaba Cloud SDKs for Java. The aliyun-java-sdk-cdn dependency includes the Request and Response classes of ApsaraVideo Live. The Request class for querying the stream ingest blacklist is DescribeLiveStreamsBlockListRequest and the corresponding Response class is DescribeLiveStreamsBlockListResponse, as shown in the following sample code:

    @Test
    public void testDescribeLiveStreamsBlockList() throws Exception {
        DescribeLiveStreamsBlockListResponse res=DescribeLiveStreamsBlockListR();
        System.out.println(res.getStreamUrls());
    }
    DescribeLiveStreamsBlockListResponse DescribeLiveStreamsBlockListR() {
        DescribeLiveStreamsBlockListRequest request =new DescribeLiveStreamsBlockListRequest();
        request.setDomainName("<DomainName>");
        DescribeLiveStreamsBlockListResponse response=null;
        try {
            response = client.getAcsResponse(request);
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        } 
        return response;
    }

    Logic of the sample code

    1. Initialize the Java client.

      The SDK uses IAcsClient to call API operations. When you initialize IAcsClient, set the region, AccessKeyId, and AccessKeySecret parameters based on the IClientProfile object. The region parameter specifies the region where the API server resides. Set this parameter to cn-hangzhou. The AccessKeyId and AccessKeySecret parameters are used for user authentication. You can use the AccessKey ID and AccessKey secret of an Alibaba Cloud account. If you want to use the AccessKey ID and AccessKey secret of a RAM user, make sure that the RAM user is granted the permissions on ApsaraVideo Live.

    2. Initialize the Request class.

      The SDK provides Request and Response classes for each operation. For more information about the request parameters for querying the stream ingest blacklist, see DescribeLiveStreamsBlockList.

    3. Initiate a request and obtain the response.

      Call the getAcsResponse method of IAcsClient to initiate a request and instantiate the returned deserialized results to the parameters of the Response class. This method also supports the ServerException and ClientException classes.

      • If an HTTP status code of 3xx or 4xx is returned, the SDK throws ClientException, which indicates a client error.

      • If an HTTP status code of 5xx is returned, the SDK throws ServerException, which indicates a server error.

      • If the SDK does not throw exceptions, the operation is successfully called.

How do I remove a stream from the stream ingest blacklist?

  • Use the ApsaraVideo Live console to remove a stream from the blacklist

    After you disable stream ingest for a live stream, you can perform the following steps to remove the stream from the blacklist: Log on to the ApsaraVideo Live console and click Streams in the left-side navigation pane. On the page that appears, select the domain name and click the Disabled Streams tab. Find the stream and then click Enable in the Actions column.

  • Use an SDK to remove a stream from the blacklist

    ApsaraVideo Live provides API operations based on OpenAPI Explorer of Alibaba Cloud. The API operations of ApsaraVideo Live are integrated into different SDKs. Download a server SDK based on your business requirements. For more information, see Server SDKs. For information about how to use the server SDKs, see Use the server SDK for Java.

    The following sample code shows how to use the server SDK for Java to remove the stream from the blacklist. To use the server SDK for Java, add the following Maven dependencies to the pom.xml file:

    <dependencies>
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-live</artifactId>
            <version>3.9.0</version>
        </dependency>
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-core</artifactId>
            <optional>true</optional>
            <version>2.3.8</version>
        </dependency>
    </dependencies>
    Note

    In the preceding sample code, the version of the SDK is for reference only. For information about how to obtain the latest version of the SDK, see Server SDKs.

    The aliyun-java-sdk-core dependency is the core module that encapsulates Alibaba Cloud APIs and is required for various Alibaba Cloud SDKs for Java. The aliyun-java-sdk-cdn dependency includes the Request and Response classes of ApsaraVideo Live. The Request class for querying the stream ingest blacklist is DescribeLiveStreamsBlockListRequest and the corresponding Response class is DescribeLiveStreamsBlockListResponse, as shown in the following sample code:

    @Test
    public void testDescribeLiveStreamsBlockList() throws Exception {
        DescribeLiveStreamsBlockListResponse res=DescribeLiveStreamsBlockListR();
        System.out.println(res.getStreamUrls());
    }
    static DescribeLiveStreamsBlockListResponse DescribeLiveStreamsBlockListR() {
        DescribeLiveStreamsBlockListRequest request =new DescribeLiveStreamsBlockListRequest();
        request.setDomainName("<DomainName>");
        DescribeLiveStreamsBlockListResponse response=null;
        try {
            response = client.getAcsResponse(request);
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        } 
        return response;
    }

    Logic of the sample code

    1. Initialize the Java client.

      The SDK uses IAcsClient to call API operations. When you initialize IAcsClient, set the region, AccessKeyId, and AccessKeySecret parameters based on the IClientProfile object. The region parameter specifies the region where the API server resides. Set this parameter to cn-hangzhou. The AccessKeyId and AccessKeySecret parameters are used for user authentication. You can use the AccessKey ID and AccessKey secret of an Alibaba Cloud account. If you want to use the AccessKey ID and AccessKey secret of a RAM user, make sure that the RAM user is granted the permissions on ApsaraVideo Live.

    2. Initialize the Request class.

      The SDK provides Request and Response classes for each operation. For more information about the request parameters for removing a stream from the stream ingest blacklist, see ResumeLiveStream.

    3. Initiate a request and obtain the response.

      Call the getAcsResponse method of IAcsClient to initiate a request and instantiate the returned deserialized results to the parameters of the Response class. This method also supports the ServerException and ClientException classes.

      • If an HTTP status code of 3xx or 4xx is returned, the SDK throws ClientException, which indicates a client error.

      • If an HTTP status code of 5xx is returned, the SDK throws ServerException, which indicates a server error.

      • If the SDK does not throw exceptions, the operation is successfully called.