全部产品
Search
文档中心

ApsaraVideo Live:Watermark Siaran Langsung

更新时间:Nov 28, 2025

Fitur watermark siaran langsung menambahkan watermark ke video siaran langsung. Dokumen ini menjelaskan cara menggunakan fitur tersebut.

Skenario

Perlindungan hak cipta: Watermark merupakan cara umum untuk melindungi hak cipta. ApsaraVideo Live menyediakan fitur watermark siaran langsung yang dapat Anda gunakan untuk menambahkan watermark ke video siaran langsung Anda.

Iklan: Selama siaran langsung, Anda dapat menggunakan fitur watermark siaran langsung untuk menampilkan label iklan, seperti informasi mengenai acara promosi.

Prasyarat

  • Untuk menggunakan fitur watermark, Anda memerlukan citra watermark. ApsaraVideo Live hanya mendukung watermark berupa citra. Jika Anda memerlukan watermark teks, Anda harus membuat citra PNG dari teks tersebut. Citra watermark dapat dalam format JPG atau PNG.

  • Diperlukan URL untuk citra watermark. ApsaraVideo Live hanya dapat mengakses citra watermark dari URL. Anda tidak dapat mengunggah citra secara langsung. Saat menggunakan fitur watermark siaran langsung, pastikan ApsaraVideo Live memiliki akses jangka panjang ke URL citra watermark Anda.

Konfigurasi fitur

Untuk menggunakan fitur watermark siaran langsung, Anda harus mengonfigurasi pengaturannya. Konfigurasi terdiri dari dua bagian: Watermark Templates dan Watermark Rules.

Templat watermark mengonfigurasi informasi watermark, seperti posisi watermark dalam video siaran langsung, transparansi, dan URL citra watermark.

Aturan watermark mengonfigurasi aturan penerapan watermark, mencakup AppName, StreamName, dan templat watermark terkait.

Konfigurasi templat watermark

Anda dapat mengonfigurasi templat watermark di Konsol atau menggunakan API.

Konfigurasi templat watermark di Konsol

  1. Masuk ke Konsol ApsaraVideo Live.

  2. Pada panel navigasi di sebelah kiri, pilih Feature Management > Watermarks. Pada halaman Watermarks, klik tab Watermark Templates.

  3. Pilih domain streaming yang ingin Anda konfigurasi.

  4. Klik Add Watermark Template dan konfigurasi templat watermark.

    image

    Anda dapat melihat efek watermark di area pratinjau. Anda dapat menyesuaikan ukuran layar pratinjau, ukuran watermark, dan posisinya untuk melihat efek secara real time. Tabel berikut menjelaskan parameter templat watermark.

    Parameter

    Deskripsi

    Template Name

    Nama templat watermark. Nama dapat berisi karakter Tionghoa, huruf Inggris, angka, tanda hubung (-), dan garis bawah (_). Panjang nama maksimal 30 karakter.

    Watermark Description

    Deskripsi watermark. Deskripsi dapat berisi karakter Tionghoa, huruf Inggris, angka, dan karakter lainnya. Panjang deskripsi maksimal 128 karakter.

    Watermark Material

    Masukkan URL citra watermark. URL harus dimulai dengan HTTP atau HTTPS.

    Kami menyarankan Anda menggunakan URL HTTP permanen dari objek Object Storage Service (OSS) atau URL yang valid dalam jangka waktu lama.

    Coordinate Origin

    Posisi perkiraan watermark dalam video output. Ini menandai posisi awal watermark. Watermark akan di-offset dari titik asal ini. Nilai yang valid:

    • Top right (default)

    • Bottom right

    • Top left

    • Bottom left

    Preview Screen Size (Width × Height)

    Masukkan dimensi berdasarkan video aktual Anda untuk mempratinjau posisi dan efek tampilan. Satuan: piksel.

    Watermark Size (Width × Height)

    Ukuran citra watermark. Lebar akan disesuaikan secara otomatis berdasarkan tinggi.

    • Nilai yang valid: [0, 4096].

    • Satuan: piksel.

    Horizontal Offset

    Offset horizontal watermark dalam video output.

    • Nilai yang valid: [0, 4096].

    • Satuan: piksel.

    Vertical Offset

    Offset vertikal watermark dalam video output.

    • Nilai yang valid: [0, 4096].

    • Satuan: piksel.

    Transparency

    Transparansi citra watermark. Nilai yang lebih kecil menunjukkan transparansi yang lebih tinggi. Nilai 100% berarti citra tidak transparan (opaque).

    • Nilai yang valid: [0, 100].

    • Satuan: persen.

  5. Klik Save untuk menyelesaikan konfigurasi templat watermark.

  6. Setelah menambahkan templat watermark, kotak dialog akan muncul yang meminta Anda menambahkan aturan watermark. Anda dapat mengklik Add untuk menambahkan aturan watermark untuk templat ini. Untuk informasi selengkapnya tentang cara mengonfigurasi aturan watermark, lihat Konfigurasi aturan watermark.

    Catatan

    Setelah mengonfigurasi templat watermark, Anda harus menambahkan aturan watermark dan mengaitkannya dengan templat tersebut. AppName dan StreamName dalam aturan harus sesuai dengan AppName dan StreamName dalam URL ingest. Kemudian, Anda harus melakukan restart stream ingest agar watermark muncul saat pemutaran.

Konfigurasi templat watermark menggunakan API

Kami menyarankan Anda menggunakan Konsol untuk mengonfigurasi templat watermark, meskipun Anda berencana menggunakan API. Parameter untuk templat watermark cukup kompleks. Konsol menyediakan antarmuka visualisasi tempat Anda dapat menyeret watermark dan mempratinjau posisinya.

  1. Pertama, tambahkan templat watermark di Konsol ApsaraVideo Live.

  2. Setelah mengonfigurasi parameter, kueri informasi templat watermark.

    // This file is auto-generated, don't edit it. Thanks.
    package demo;
    
    import com.aliyun.auth.credentials.Credential;
    import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
    import com.aliyun.core.http.HttpClient;
    import com.aliyun.core.http.HttpMethod;
    import com.aliyun.core.http.ProxyOptions;
    import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
    import com.aliyun.sdk.service.live20161101.models.*;
    import com.aliyun.sdk.service.live20161101.*;
    import com.google.gson.Gson;
    import darabonba.core.RequestConfiguration;
    import darabonba.core.client.ClientOverrideConfiguration;
    import darabonba.core.utils.CommonUtil;
    import darabonba.core.TeaPair;
    
    //import javax.net.ssl.KeyManager;
    //import javax.net.ssl.X509TrustManager;
    import java.net.InetSocketAddress;
    import java.time.Duration;
    import java.util.*;
    import java.util.concurrent.CompletableFuture;
    import java.io.*;
    
    public class DescribeLiveStreamWatermarks {
        public static void main(String[] args) throws Exception {
    
            // HttpClient Configuration
            /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                    .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout. The default is 10 seconds.
                    .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout. The default is 20 seconds.
                    .maxConnections(128) // Set the connection pool size.
                    .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout. The default is 30 seconds.
                    // Configure the proxy.
                    .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                            .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                    // For an HTTPS connection, you must configure the certificate or ignore it (.ignoreSSL(true)).
                    .x509TrustManagers(new X509TrustManager[]{})
                    .keyManagers(new KeyManager[]{})
                    .ignoreSSL(false)
                    .build();*/
    
            // Configure credentials, including the AccessKey ID, AccessKey secret, and token.
            StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                    // Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are set.
                    .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                    .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                    //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // Use an STS token.
                    .build());
    
            // Configure the client.
            AsyncClient client = AsyncClient.builder()
                    .region("<Your RegionId>") // Region ID.
                    //.httpClient(httpClient) // Use the configured HttpClient. Otherwise, the default Apache HttpClient is used.
                    .credentialsProvider(provider)
                    //.serviceConfiguration(Configuration.create()) // Service-level configuration.
                    // Override the client-level configuration. You can set the endpoint, HTTP request parameters, and more.
                    .overrideConfiguration(
                            ClientOverrideConfiguration.create()
                                      // For the endpoint, see https://api.aliyun.com/product/live.
                                    .setEndpointOverride("live.aliyuncs.com")
                            //.setConnectTimeout(Duration.ofSeconds(30))
                    )
                    .build();
    
            // Set the parameters for the API request.
            DescribeLiveStreamWatermarksRequest describeLiveStreamWatermarksRequest = DescribeLiveStreamWatermarksRequest.builder()
                    .regionId("<Your RegionId>")
                    .domain("<Your Domain>")
                    .keyWord("<Your KeyWord>")
                    // Override the request-level configuration. You can set HTTP request parameters and more.
                    // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                    .build();
    
            // Asynchronously get the return value of the API request.
            CompletableFuture<DescribeLiveStreamWatermarksResponse> response = client.describeLiveStreamWatermarks(describeLiveStreamWatermarksRequest);
            // Synchronously get the return value of the API request.
            DescribeLiveStreamWatermarksResponse resp = response.get();
            System.out.println(new Gson().toJson(resp));
            // Asynchronously process the return value.
            /*response.thenAccept(resp -> {
                System.out.println(new Gson().toJson(resp));
            }).exceptionally(throwable -> { // Handle exceptions.
                System.out.println(throwable.getMessage());
                return null;
            });*/
    
            // Finally, close the client.
            client.close();
        }
    
    }
    Catatan
    • Anda dapat mengkueri daftar templat watermark berdasarkan ID templat atau nama. Untuk informasi selengkapnya, lihat dokumentasi API DescribeLiveStreamWatermarks.

    • Anda dapat menyimpan informasi templat watermark yang dikueri sebagai templat di sistem bisnis Anda.

  3. Tambahkan konfigurasi templat watermark.

    // This file is auto-generated, don't edit it. Thanks.
    package demo;
    
    import com.aliyun.auth.credentials.Credential;
    import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
    import com.aliyun.core.http.HttpClient;
    import com.aliyun.core.http.HttpMethod;
    import com.aliyun.core.http.ProxyOptions;
    import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
    import com.aliyun.sdk.service.live20161101.models.*;
    import com.aliyun.sdk.service.live20161101.*;
    import com.google.gson.Gson;
    import darabonba.core.RequestConfiguration;
    import darabonba.core.client.ClientOverrideConfiguration;
    import darabonba.core.utils.CommonUtil;
    import darabonba.core.TeaPair;
    
    //import javax.net.ssl.KeyManager;
    //import javax.net.ssl.X509TrustManager;
    import java.net.InetSocketAddress;
    import java.time.Duration;
    import java.util.*;
    import java.util.concurrent.CompletableFuture;
    import java.io.*;
    
    public class AddLiveStreamWatermark {
        public static void main(String[] args) throws Exception {
    
            // HttpClient Configuration
            /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                    .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout. The default is 10 seconds.
                    .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout. The default is 20 seconds.
                    .maxConnections(128) // Set the connection pool size.
                    .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout. The default is 30 seconds.
                    // Configure the proxy.
                    .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                            .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                    // For an HTTPS connection, you must configure the certificate or ignore it (.ignoreSSL(true)).
                    .x509TrustManagers(new X509TrustManager[]{})
                    .keyManagers(new KeyManager[]{})
                    .ignoreSSL(false)
                    .build();*/
    
            // Configure credentials, including the AccessKey ID, AccessKey secret, and token.
            StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                    // Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are set.
                    .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                    .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                    //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // Use an STS token.
                    .build());
    
            // Configure the client.
            AsyncClient client = AsyncClient.builder()
                    .region("<Your RegionId>") // Region ID.
                    //.httpClient(httpClient) // Use the configured HttpClient. Otherwise, the default Apache HttpClient is used.
                    .credentialsProvider(provider)
                    //.serviceConfiguration(Configuration.create()) // Service-level configuration.
                    // Override the client-level configuration. You can set the endpoint, HTTP request parameters, and more.
                    .overrideConfiguration(
                            ClientOverrideConfiguration.create()
                                      // For the endpoint, see https://api.aliyun.com/product/live.
                                    .setEndpointOverride("live.aliyuncs.com")
                            //.setConnectTimeout(Duration.ofSeconds(30))
                    )
                    .build();
    
            // Set the parameters for the API request.
            AddLiveStreamWatermarkRequest addLiveStreamWatermarkRequest = AddLiveStreamWatermarkRequest.builder()
                    .regionId("<Your RegionId>")
                    .type(1)
                    .name("<Your Name>")
                    .refWidth(1920)
                    .refHeight(1080)
                    .xOffset(50F)
                    .yOffset(100F)
                    .height(200)
                    .transparency(255)
                    .offsetCorner("<Your OffsetCorner>")
                    .pictureUrl("<Your PictureUrl>")
                    // Override the request-level configuration. You can set HTTP request parameters and more.
                    // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                    .build();
    
            // Asynchronously get the return value of the API request.
            CompletableFuture<AddLiveStreamWatermarkResponse> response = client.addLiveStreamWatermark(addLiveStreamWatermarkRequest);
            // Synchronously get the return value of the API request.
            AddLiveStreamWatermarkResponse resp = response.get();
            System.out.println(new Gson().toJson(resp));
            // Asynchronously process the return value.
            /*response.thenAccept(resp -> {
                System.out.println(new Gson().toJson(resp));
            }).exceptionally(throwable -> { // Handle exceptions.
                System.out.println(throwable.getMessage());
                return null;
            });*/
    
            // Finally, close the client.
            client.close();
        }
    
    }
    Catatan

    Untuk deskripsi setiap parameter, lihat dokumentasi API AddLiveStreamWatermark.

    Langkah ini menyelesaikan konfigurasi templat watermark. Setelah mengonfigurasi templat watermark, Anda harus mengonfigurasi aturan watermark.

Penting
  • Watermark siaran langsung dan time shifting tidak dapat dikonfigurasi dan digunakan secara bersamaan.

Konfigurasi aturan watermark

Setelah mengonfigurasi templat watermark, Anda harus mengonfigurasi aturan watermark dan mengaitkannya dengan templat watermark.

Anda dapat mengonfigurasi aturan watermark di Konsol atau menggunakan API.

Konfigurasi aturan watermark di Konsol

  1. Masuk ke Konsol ApsaraVideo Live.

  2. Pada panel navigasi di sebelah kiri, pilih Feature Management > Watermarks. Pada halaman Watermarks, klik tab Watermark Rules.

  3. Pilih domain streaming yang ingin Anda konfigurasi.

  4. Klik Add Watermark Rule.

    image

    Tabel berikut menjelaskan parameter aturan watermark.

    Parameter

    Deskripsi

    Rule Name

    Nama aturan watermark. Nama dapat berisi karakter Tionghoa, huruf Inggris, angka, dan karakter lainnya. Panjang nama maksimal 32 karakter.

    Rule Description

    Deskripsi aturan watermark. Deskripsi dapat berisi karakter Tionghoa, huruf Inggris, angka, dan karakter lainnya. Panjang deskripsi maksimal 128 karakter.

    Application Name

    Nama aplikasi tempat aliran tersebut berada. AppName harus sama dengan AppName dalam URL ingest agar templat watermark berlaku. Nama dapat berisi angka, huruf besar dan kecil, tanda hubung (-), dan garis bawah (_). Panjang nama maksimal 256 karakter.

    Stream Name

    Nama aliran siaran langsung. Aturannya sebagai berikut:

    • Masukkan nama aliran tertentu untuk mencocokkan hanya aliran tersebut. Contoh: liveStreamA.

    • Anda dapat menggunakan pencocokan wildcard.

      Untuk mencocokkan semua aliran siaran langsung, masukkan tanda bintang (*).

      Anda juga dapat melakukan pencocokan awalan atau akhiran. Formatnya mengharuskan Anda membungkus item yang cocok dalam tanda kurung (), memisahkan beberapa item dengan garis vertikal |, dan menempatkan tanda bintang (*) untuk pencocokan fuzzy hanya di awal atau akhir string. Misalnya, (abc|123)* mencocokkan semua aliran dengan awalan abc atau 123, dan *(t1|t2) mencocokkan semua aliran dengan akhiran t1 atau t2.

    • Nama dapat berisi angka, huruf besar dan kecil, tanda hubung (-), garis bawah (_), tanda bintang (*), dan tanda sama dengan (=). Panjang nama maksimal 256 karakter.

    Watermark Templates

    Pilih templat watermark yang telah dikonfigurasi. Jika tidak tersedia templat, tambahkan terlebih dahulu. Untuk informasi selengkapnya, lihat Konfigurasi templat watermark.

  5. Klik Save untuk menyelesaikan konfigurasi aturan watermark.

    Catatan

    Setelah mengonfigurasi aturan watermark, Anda harus melakukan restart stream ingest agar watermark muncul saat pemutaran.

Konfigurasi aturan watermark menggunakan API

// This file is auto-generated, don't edit it. Thanks.
package demo;

import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.core.http.HttpClient;
import com.aliyun.core.http.HttpMethod;
import com.aliyun.core.http.ProxyOptions;
import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
import com.aliyun.sdk.service.live20161101.models.*;
import com.aliyun.sdk.service.live20161101.*;
import com.google.gson.Gson;
import darabonba.core.RequestConfiguration;
import darabonba.core.client.ClientOverrideConfiguration;
import darabonba.core.utils.CommonUtil;
import darabonba.core.TeaPair;

//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.io.*;

public class AddLiveStreamWatermarkRule {
    public static void main(String[] args) throws Exception {

        // HttpClient Configuration
        /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout. The default is 10 seconds.
                .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout. The default is 20 seconds.
                .maxConnections(128) // Set the connection pool size.
                .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout. The default is 30 seconds.
                // Configure the proxy.
                .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                        .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                // For an HTTPS connection, you must configure the certificate or ignore it (.ignoreSSL(true)).
                .x509TrustManagers(new X509TrustManager[]{})
                .keyManagers(new KeyManager[]{})
                .ignoreSSL(false)
                .build();*/

        // Configure credentials, including the AccessKey ID, AccessKey secret, and token.
        StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                // Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are set.
                .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // Use an STS token.
                .build());

        // Configure the client.
        AsyncClient client = AsyncClient.builder()
                .region("<Your RegionId>") // Region ID.
                //.httpClient(httpClient) // Use the configured HttpClient. Otherwise, the default Apache HttpClient is used.
                .credentialsProvider(provider)
                //.serviceConfiguration(Configuration.create()) // Service-level configuration.
                // Override the client-level configuration. You can set the endpoint, HTTP request parameters, and more.
                .overrideConfiguration(
                        ClientOverrideConfiguration.create()
                                  // For the endpoint, see https://api.aliyun.com/product/live.
                                .setEndpointOverride("live.aliyuncs.com")
                        //.setConnectTimeout(Duration.ofSeconds(30))
                )
                .build();

        // Set the parameters for the API request.
        AddLiveStreamWatermarkRuleRequest addLiveStreamWatermarkRuleRequest = AddLiveStreamWatermarkRuleRequest.builder()
                .regionId("<Your RegionId>")
                .name("<Your Name>")
                .domain("<Your Domain>")
                .app("<Your App>")
                .stream("<Your Stream>")
                .templateId("<Your TemplateId>")
                // Override the request-level configuration. You can set HTTP request parameters and more.
                // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                .build();

        // Asynchronously get the return value of the API request.
        CompletableFuture<AddLiveStreamWatermarkRuleResponse> response = client.addLiveStreamWatermarkRule(addLiveStreamWatermarkRuleRequest);
        // Synchronously get the return value of the API request.
        AddLiveStreamWatermarkRuleResponse resp = response.get();
        System.out.println(new Gson().toJson(resp));
        // Asynchronously process the return value.
        /*response.thenAccept(resp -> {
            System.out.println(new Gson().toJson(resp));
        }).exceptionally(throwable -> { // Handle exceptions.
            System.out.println(throwable.getMessage());
            return null;
        });*/

        // Finally, close the client.
        client.close();
    }

}
Catatan
  • <AppName> dapat berisi hingga 256 karakter, termasuk angka, huruf besar dan kecil, tanda hubung (-), dan garis bawah (_). Tanda bintang (*) Not Supported.

  • Pencocokan aturan watermark memiliki prioritas. Aturan di mana <StreamName> bukan tanda bintang (*) akan dicocokkan terlebih dahulu.

  • Untuk informasi selengkapnya tentang parameter, lihat dokumentasi API AddLiveStreamWatermarkRule.

Gunakan fitur

Setelah mengonfigurasi templat watermark dan aturan watermark, Anda dapat menggunakan fitur watermark siaran langsung dengan memulai stream ingest dan pemutaran. Gambar berikut menunjukkan contoh video siaran langsung yang memiliki watermark.

image

Pada contoh ini, watermark dibuat dari citra PNG berisi teks.

Atur transparansi watermark

Kode berikut menunjukkan contoh cara mengatur transparansi watermark:

// The transparency of the watermark. A smaller value indicates higher transparency. Valid values: 0 to 255. Default value: 255.
addLiveStreamWatermarkRequest.setTransparency(255);

Sebagai contoh, jika Anda mengatur transparansi menjadi 128, video siaran langsung contoh akan tampak seperti pada gambar berikut:

image

Perbarui watermark

Kode contoh untuk memperbarui templat watermark

// This file is auto-generated, don't edit it. Thanks.
package demo;

import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.core.http.HttpClient;
import com.aliyun.core.http.HttpMethod;
import com.aliyun.core.http.ProxyOptions;
import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
import com.aliyun.sdk.service.live20161101.models.*;
import com.aliyun.sdk.service.live20161101.*;
import com.google.gson.Gson;
import darabonba.core.RequestConfiguration;
import darabonba.core.client.ClientOverrideConfiguration;
import darabonba.core.utils.CommonUtil;
import darabonba.core.TeaPair;

//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.io.*;

public class UpdateLiveStreamWatermark {
    public static void main(String[] args) throws Exception {

        // HttpClient Configuration
        /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout. The default is 10 seconds.
                .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout. The default is 20 seconds.
                .maxConnections(128) // Set the connection pool size.
                .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout. The default is 30 seconds.
                // Configure the proxy.
                .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                        .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                // For an HTTPS connection, you must configure the certificate or ignore it (.ignoreSSL(true)).
                .x509TrustManagers(new X509TrustManager[]{})
                .keyManagers(new KeyManager[]{})
                .ignoreSSL(false)
                .build();*/

        // Configure credentials, including the AccessKey ID, AccessKey secret, and token.
        StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                // Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are set.
                .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // Use an STS token.
                .build());

        // Configure the client.
        AsyncClient client = AsyncClient.builder()
                .region("<Your RegionId>") // Region ID.
                //.httpClient(httpClient) // Use the configured HttpClient. Otherwise, the default Apache HttpClient is used.
                .credentialsProvider(provider)
                //.serviceConfiguration(Configuration.create()) // Service-level configuration.
                // Override the client-level configuration. You can set the endpoint, HTTP request parameters, and more.
                .overrideConfiguration(
                        ClientOverrideConfiguration.create()
                                  // For the endpoint, see https://api.aliyun.com/product/live.
                                .setEndpointOverride("live.aliyuncs.com")
                        //.setConnectTimeout(Duration.ofSeconds(30))
                )
                .build();

        // Set the parameters for the API request.
        UpdateLiveStreamWatermarkRequest updateLiveStreamWatermarkRequest = UpdateLiveStreamWatermarkRequest.builder()
                .regionId("<Your RegionId>")
                .templateId("<Your templateId>")
                .name("<Your name>")
                .description("<Your description>")
                // Override the request-level configuration. You can set HTTP request parameters and more.
                // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                .build();

        // Asynchronously get the return value of the API request.
        CompletableFuture<UpdateLiveStreamWatermarkResponse> response = client.updateLiveStreamWatermark(updateLiveStreamWatermarkRequest);
        // Synchronously get the return value of the API request.
        UpdateLiveStreamWatermarkResponse resp = response.get();
        System.out.println(new Gson().toJson(resp));
        // Asynchronously process the return value.
        /*response.thenAccept(resp -> {
            System.out.println(new Gson().toJson(resp));
        }).exceptionally(throwable -> { // Handle exceptions.
            System.out.println(throwable.getMessage());
            return null;
        });*/

        // Finally, close the client.
        client.close();
    }

}

Catatan
  • <regionId> harus sama dengan wilayah pusat siaran langsung untuk nama domain yang sesuai dengan templat. Untuk mendapatkan ID wilayah, lihat Titik akhir layanan.

  • Untuk informasi selengkapnya tentang parameter, lihat dokumentasi API UpdateLiveStreamWatermark.

Kode contoh untuk memperbarui aturan watermark

// This file is auto-generated, don't edit it. Thanks.
package demo;

import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.core.http.HttpClient;
import com.aliyun.core.http.HttpMethod;
import com.aliyun.core.http.ProxyOptions;
import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
import com.aliyun.sdk.service.live20161101.models.*;
import com.aliyun.sdk.service.live20161101.*;
import com.google.gson.Gson;
import darabonba.core.RequestConfiguration;
import darabonba.core.client.ClientOverrideConfiguration;
import darabonba.core.utils.CommonUtil;
import darabonba.core.TeaPair;

//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.io.*;

public class UpdateLiveStreamWatermarkRule {
    public static void main(String[] args) throws Exception {

        // HttpClient Configuration
        /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout. The default is 10 seconds.
                .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout. The default is 20 seconds.
                .maxConnections(128) // Set the connection pool size.
                .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout. The default is 30 seconds.
                // Configure the proxy.
                .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                        .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                // For an HTTPS connection, you must configure the certificate or ignore it (.ignoreSSL(true)).
                .x509TrustManagers(new X509TrustManager[]{})
                .keyManagers(new KeyManager[]{})
                .ignoreSSL(false)
                .build();*/

        // Configure credentials, including the AccessKey ID, AccessKey secret, and token.
        StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                // Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are set.
                .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // Use an STS token.
                .build());

        // Configure the client.
        AsyncClient client = AsyncClient.builder()
                .region("<Your RegionId>") // Region ID.
                //.httpClient(httpClient) // Use the configured HttpClient. Otherwise, the default Apache HttpClient is used.
                .credentialsProvider(provider)
                //.serviceConfiguration(Configuration.create()) // Service-level configuration.
                // Override the client-level configuration. You can set the endpoint, HTTP request parameters, and more.
                .overrideConfiguration(
                        ClientOverrideConfiguration.create()
                                  // For the endpoint, see https://api.aliyun.com/product/live.
                                .setEndpointOverride("live.aliyuncs.com")
                        //.setConnectTimeout(Duration.ofSeconds(30))
                )
                .build();

        // Set the parameters for the API request.
        UpdateLiveStreamWatermarkRuleRequest updateLiveStreamWatermarkRuleRequest = UpdateLiveStreamWatermarkRuleRequest.builder()
                .regionId("<Your RegionId>")
                .ruleId("")
                // Override the request-level configuration. You can set HTTP request parameters and more.
                // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                .build();

        // Asynchronously get the return value of the API request.
        CompletableFuture<UpdateLiveStreamWatermarkRuleResponse> response = client.updateLiveStreamWatermarkRule(updateLiveStreamWatermarkRuleRequest);
        // Synchronously get the return value of the API request.
        UpdateLiveStreamWatermarkRuleResponse resp = response.get();
        System.out.println(new Gson().toJson(resp));
        // Asynchronously process the return value.
        /*response.thenAccept(resp -> {
            System.out.println(new Gson().toJson(resp));
        }).exceptionally(throwable -> { // Handle exceptions.
            System.out.println(throwable.getMessage());
            return null;
        });*/

        // Finally, close the client.
        client.close();
    }

}

Catatan
  • <regionId> harus sama dengan wilayah pusat siaran langsung untuk nama domain yang sesuai dengan templat. Untuk mendapatkan ID wilayah, lihat Titik akhir layanan.

  • Saat memperbarui aturan watermark, Anda dapat memperbarui informasi lain dalam aturan tersebut. Untuk informasi selengkapnya, lihat dokumentasi API UpdateLiveStreamWatermarkRule.

Setelah memperbarui templat watermark atau aturan, Anda harus melakukan restart stream ingest agar perubahan berlaku. Namun, terkadang Anda perlu memperbarui watermark selama siaran langsung. Hal ini dapat dilakukan menggunakan fitur dynamically update watermarks.

Anda dapat memanggil API DynamicUpdateWaterMarkStreamRule untuk menyesuaikan watermark secara dinamis.

Kode contoh untuk memperbarui watermark secara dinamis

// This file is auto-generated, don't edit it. Thanks.
package demo;

import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.core.http.HttpClient;
import com.aliyun.core.http.HttpMethod;
import com.aliyun.core.http.ProxyOptions;
import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
import com.aliyun.sdk.service.live20161101.models.*;
import com.aliyun.sdk.service.live20161101.*;
import com.google.gson.Gson;
import darabonba.core.RequestConfiguration;
import darabonba.core.client.ClientOverrideConfiguration;
import darabonba.core.utils.CommonUtil;
import darabonba.core.TeaPair;

//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.io.*;

public class DynamicUpdateWaterMarkStreamRule {
    public static void main(String[] args) throws Exception {

        // HttpClient Configuration
        /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout. The default is 10 seconds.
                .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout. The default is 20 seconds.
                .maxConnections(128) // Set the connection pool size.
                .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout. The default is 30 seconds.
                // Configure the proxy.
                .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                        .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                // For an HTTPS connection, you must configure the certificate or ignore it (.ignoreSSL(true)).
                .x509TrustManagers(new X509TrustManager[]{})
                .keyManagers(new KeyManager[]{})
                .ignoreSSL(false)
                .build();*/

        // Configure credentials, including the AccessKey ID, AccessKey secret, and token.
        StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                // Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are set.
                .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // Use an STS token.
                .build());

        // Configure the client.
        AsyncClient client = AsyncClient.builder()
                .region("<Your RegionID>") // Region ID.
                //.httpClient(httpClient) // Use the configured HttpClient. Otherwise, the default Apache HttpClient is used.
                .credentialsProvider(provider)
                //.serviceConfiguration(Configuration.create()) // Service-level configuration.
                // Override the client-level configuration. You can set the endpoint, HTTP request parameters, and more.
                .overrideConfiguration(
                        ClientOverrideConfiguration.create()
                                  // For the endpoint, see https://api.aliyun.com/product/live.
                                .setEndpointOverride("live.aliyuncs.com")
                        //.setConnectTimeout(Duration.ofSeconds(30))
                )
                .build();

        // Set the parameters for the API request.
        DynamicUpdateWaterMarkStreamRuleRequest dynamicUpdateWaterMarkStreamRuleRequest = DynamicUpdateWaterMarkStreamRuleRequest.builder()
                .regionId("<Your RegionId>")
                .domain("<Your Domain>")
                .app("<Your App>")
                .stream("<Your Stream>")
                .templateId("<Your TemplateId>")
                // Override the request-level configuration. You can set HTTP request parameters and more.
                // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                .build();

        // Asynchronously get the return value of the API request.
        CompletableFuture<DynamicUpdateWaterMarkStreamRuleResponse> response = client.dynamicUpdateWaterMarkStreamRule(dynamicUpdateWaterMarkStreamRuleRequest);
        // Synchronously get the return value of the API request.
        DynamicUpdateWaterMarkStreamRuleResponse resp = response.get();
        System.out.println(new Gson().toJson(resp));
        // Asynchronously process the return value.
        /*response.thenAccept(resp -> {
            System.out.println(new Gson().toJson(resp));
        }).exceptionally(throwable -> { // Handle exceptions.
            System.out.println(throwable.getMessage());
            return null;
        });*/

        // Finally, close the client.
        client.close();
    }

}

Penting
  • <TemplateId> dapat berupa ID templat baru atau templat asli. Setelah memanggil metode ini, watermark akan diperbarui berdasarkan konfigurasi terbaru dari templat tersebut, mencakup citra, transparansi, dan posisi.

  • Saat ini, Anda Cannot Dynamically Update aturan watermark jika pencocokan fuzzy dikonfigurasi untuk StreamName.

Hapus templat watermark

Untuk menghapus Watermark Templates, Anda harus terlebih dahulu menghapus aturan watermark terkait.

Kode contoh untuk menghapus aturan watermark

// This file is auto-generated, don't edit it. Thanks.
package demo;

import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.core.http.HttpClient;
import com.aliyun.core.http.HttpMethod;
import com.aliyun.core.http.ProxyOptions;
import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
import com.aliyun.sdk.service.live20161101.models.*;
import com.aliyun.sdk.service.live20161101.*;
import com.google.gson.Gson;
import darabonba.core.RequestConfiguration;
import darabonba.core.client.ClientOverrideConfiguration;
import darabonba.core.utils.CommonUtil;
import darabonba.core.TeaPair;

//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.io.*;

public class DeleteLiveStreamWatermarkRule {
    public static void main(String[] args) throws Exception {

        // HttpClient Configuration
        /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout. The default is 10 seconds.
                .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout. The default is 20 seconds.
                .maxConnections(128) // Set the connection pool size.
                .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout. The default is 30 seconds.
                // Configure the proxy.
                .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                        .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                // For an HTTPS connection, you must configure the certificate or ignore it (.ignoreSSL(true)).
                .x509TrustManagers(new X509TrustManager[]{})
                .keyManagers(new KeyManager[]{})
                .ignoreSSL(false)
                .build();*/

        // Configure credentials, including the AccessKey ID, AccessKey secret, and token.
        StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                // Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are set.
                .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // Use an STS token.
                .build());

        // Configure the client.
        AsyncClient client = AsyncClient.builder()
                .region("<Your RegionId>") // Region ID.
                //.httpClient(httpClient) // Use the configured HttpClient. Otherwise, the default Apache HttpClient is used.
                .credentialsProvider(provider)
                //.serviceConfiguration(Configuration.create()) // Service-level configuration.
                // Override the client-level configuration. You can set the endpoint, HTTP request parameters, and more.
                .overrideConfiguration(
                        ClientOverrideConfiguration.create()
                                  // For the endpoint, see https://api.aliyun.com/product/live.
                                .setEndpointOverride("live.aliyuncs.com")
                        //.setConnectTimeout(Duration.ofSeconds(30))
                )
                .build();

        // Set the parameters for the API request.
        DeleteLiveStreamWatermarkRuleRequest deleteLiveStreamWatermarkRuleRequest = DeleteLiveStreamWatermarkRuleRequest.builder()
                .regionId("<Your RegionId>")
                .domain("<Your Domain>")
                // Override the request-level configuration. You can set HTTP request parameters and more.
                // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                .build();

        // Asynchronously get the return value of the API request.
        CompletableFuture<DeleteLiveStreamWatermarkRuleResponse> response = client.deleteLiveStreamWatermarkRule(deleteLiveStreamWatermarkRuleRequest);
        // Synchronously get the return value of the API request.
        DeleteLiveStreamWatermarkRuleResponse resp = response.get();
        System.out.println(new Gson().toJson(resp));
        // Asynchronously process the return value.
        /*response.thenAccept(resp -> {
            System.out.println(new Gson().toJson(resp));
        }).exceptionally(throwable -> { // Handle exceptions.
            System.out.println(throwable.getMessage());
            return null;
        });*/

        // Finally, close the client.
        client.close();
    }

}

Catatan

Anda dapat menghapus aturan watermark menggunakan AppName. Untuk informasi selengkapnya, lihat DeleteLiveStreamWatermarkRule - Hapus aturan watermark.

Kode contoh untuk menghapus templat watermark

// This file is auto-generated, don't edit it. Thanks.
package demo;

import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.core.http.HttpClient;
import com.aliyun.core.http.HttpMethod;
import com.aliyun.core.http.ProxyOptions;
import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
import com.aliyun.sdk.service.live20161101.models.*;
import com.aliyun.sdk.service.live20161101.*;
import com.google.gson.Gson;
import darabonba.core.RequestConfiguration;
import darabonba.core.client.ClientOverrideConfiguration;
import darabonba.core.utils.CommonUtil;
import darabonba.core.TeaPair;

//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.io.*;

public class DeleteLiveStreamWatermark {
    public static void main(String[] args) throws Exception {

        // HttpClient Configuration
        /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout. The default is 10 seconds.
                .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout. The default is 20 seconds.
                .maxConnections(128) // Set the connection pool size.
                .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout. The default is 30 seconds.
                // Configure the proxy.
                .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))
                        .setCredentials("<your-proxy-username>", "<your-proxy-password>"))
                // For an HTTPS connection, you must configure the certificate or ignore it (.ignoreSSL(true)).
                .x509TrustManagers(new X509TrustManager[]{})
                .keyManagers(new KeyManager[]{})
                .ignoreSSL(false)
                .build();*/

        // Configure credentials, including the AccessKey ID, AccessKey secret, and token.
        StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                // Make sure that the ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET environment variables are set.
                .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // Use an STS token.
                .build());

        // Configure the client.
        AsyncClient client = AsyncClient.builder()
                .region("<Your RegionId>") // Region ID.
                //.httpClient(httpClient) // Use the configured HttpClient. Otherwise, the default Apache HttpClient is used.
                .credentialsProvider(provider)
                //.serviceConfiguration(Configuration.create()) // Service-level configuration.
                // Override the client-level configuration. You can set the endpoint, HTTP request parameters, and more.
                .overrideConfiguration(
                        ClientOverrideConfiguration.create()
                                  // For the endpoint, see https://api.aliyun.com/product/live.
                                .setEndpointOverride("live.aliyuncs.com")
                        //.setConnectTimeout(Duration.ofSeconds(30))
                )
                .build();

        // Set the parameters for the API request.
        DeleteLiveStreamWatermarkRequest deleteLiveStreamWatermarkRequest = DeleteLiveStreamWatermarkRequest.builder()
                .regionId("<Your RegionId>")
                .templateId("<Your TemplateId>")
                // Override the request-level configuration. You can set HTTP request parameters and more.
                // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                .build();

        // Asynchronously get the return value of the API request.
        CompletableFuture<DeleteLiveStreamWatermarkResponse> response = client.deleteLiveStreamWatermark(deleteLiveStreamWatermarkRequest);
        // Synchronously get the return value of the API request.
        DeleteLiveStreamWatermarkResponse resp = response.get();
        System.out.println(new Gson().toJson(resp));
        // Asynchronously process the return value.
        /*response.thenAccept(resp -> {
            System.out.println(new Gson().toJson(resp));
        }).exceptionally(throwable -> { // Handle exceptions.
            System.out.println(throwable.getMessage());
            return null;
        });*/

        // Finally, close the client.
        client.close();
    }

}

Catatan
  • <regionId> harus sama dengan wilayah pusat siaran langsung untuk nama domain yang sesuai dengan templat. Untuk mendapatkan ID wilayah, lihat Titik akhir layanan.

  • Untuk informasi selengkapnya, lihat dokumentasi API DeleteLiveStreamWatermark.

Referensi

Untuk informasi selengkapnya tentang cara menggunakan Java SDK, lihat Panduan penggunaan Java SDK.