Menyiapkan aplikasi klien Anda untuk bekerja dengan Google Ad Manager
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Mengumpulkan informasi yang diperlukan untuk aplikasi klien Anda
Anda harus memiliki informasi berikut yang diperlukan agar
Google Ad Manager dapat membuat sesi live stream:
Kolom
Deskripsi
projectNumber
Google Cloud Nomor project
(PROJECT_NUMBER)
yang digunakan untuk membuat sesi yang mengaktifkan Ad Manager; atau,
Anda dapat menggunakan project ID.
region
Lokasi (LOCATION) tempat konfigurasi aktif didaftarkan.
liveConfigId
ID
konfigurasi live yang digunakan untuk
mendaftarkan peristiwa live stream ke Video Stitcher API. Berikut ini
menunjukkan format untuk nama resource konfigurasi lengkap:
ID konfigurasi adalah bagian terakhir dari nama lengkap
(LIVE_CONFIG_ID). Perhatikan bahwa lokasi konfigurasi harus berada di lokasi yang sama dengan tempat Anda membuat sesi.
customAssetKey
Kunci aset kustom
(CUSTOM_ASSET_KEY)
yang dibuat selama pendaftaran konfigurasi live;
IMA SDK memerlukan nilai ini untuk membuat streaming.
networkCode
ID numerik
(NETWORK_CODE) untuk
jaringan Ad Manager Anda.
Karena ini adalah token berumur pendek, Anda perlu membuatnya lagi secara berkala dengan perintah gcloud auth print-access-token dan mengirim token baru ke aplikasi klien. Lihat bagian berikut untuk informasi
selengkapnya tentang cara mem-build layanan produksi untuk menyediakan token jangka pendek.
Membuat layanan untuk memberikan informasi ke aplikasi klien Anda
Buat layanan yang dapat memberikan informasi yang diperlukan untuk diteruskan ke
klien. Saat aplikasi meminta informasi dari layanan Anda tentang cara
memutar live stream, layanan harus menampilkan informasi yang dijelaskan dalam
Tabel 1.
Secara khusus, layanan harus dapat menyediakan token OAuth ke
aplikasi klien dengan aman. Konfigurasikan layanan ini menggunakan dua akun
layanan, satu akun
meniru akun lainnya.
Satu akun layanan memiliki peran Service Token Creator dan membuat token
OAuth untuk akun layanan yang memiliki peran Video Stitcher User. Misalnya:
Akun layanan 1: Ini adalah akun layanan pemanggil. Akun ini memiliki izin Service Token Creator di akun layanan 2 dan meniru identitas akun layanan 2 ke aplikasi klien.
Akun layanan 2: Ini adalah akun layanan yang memiliki hak istimewa dan memiliki
peran Video Stitcher User untuk membuat sesi.
Untuk informasi tentang cara menyediakan token OAuth dari layanan Anda, termasuk contoh kode library klien, lihat
Membuat token akses jangka pendek.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[],[],null,["# Prepare for your client application to work with Google Ad Manager\n\nCollect the required information for your client applications\n-------------------------------------------------------------\n\nYou should have the following information that is required for\nGoogle Ad Manager to create a live stream session:\n\n**Table 1.** Required information for Ad Manager-enabled live stream sessions\n\nGenerate short-lived OAuth tokens for testing\n---------------------------------------------\n\nTo generate a\n[short-lived OAuth token](/iam/docs/creating-short-lived-service-account-credentials)\nassociated with the\n[service account](/video-stitcher/docs/how-to/gam/before-you-begin#create-service-account-to-create-sessions) with the **Video Stitcher User** role, follow\nthese steps:\n\n1. Replace \u003cvar translate=\"no\"\u003ePATH_TO_YOUR_SERVICE_KEY\u003c/var\u003e with the path to the JSON file you downloaded to your local machine. \n\n ```bash\n gcloud auth activate-service-account --key-file PATH_TO_YOUR_SERVICE_KEY\n ```\n2. Retrieve the OAuth 2.0 bearer token from the service account: \n\n ```bash\n gcloud auth print-access-token\n ```\n\nBecause this is a short-lived token, you need to generate it again\nperiodically with the `gcloud auth print-access-token` command and send the new\ntokens to your client applications. See the following section for more\ninformation on building a production service to provide short-lived tokens.\n| **Important:** Regenerating an OAuth token is a time-consuming operation. Try to reuse an OAuth token as much as possible when creating sessions. You can extend the lifetime of a token using the [`--lifetime` flag](/sdk/gcloud/reference/auth/application-default/print-access-token).\n\nCreate a service to provide information to your client applications\n-------------------------------------------------------------------\n\nCreate a service that can provide the required information to be passed to the\nclient. When the application requests information from your service on how to\nplay a live stream, the service should return the information described in\n[Table 1](#collect-info).\n\nIn particular, the service must be able to provide OAuth tokens to\nclient applications in a secure manner. Configure this service using two service\naccounts, one\n[impersonating the other](/docs/authentication/use-service-account-impersonation).\nOne service account has the **Service Token Creator** role and creates an OAuth\ntoken for the service account that has the **Video Stitcher User** role. For\nexample:\n\n- Service account 1: This is the caller service account. This account has the **Service Token Creator** permission on service account 2 and impersonates service account 2 to client applications.\n- Service account 2: This is the privilege-bearing service account that has the **Video Stitcher User** role to create sessions.\n\nFor information on providing an OAuth token from your service, including client\nlibrary code samples, see\n[Create a short-lived access token](/iam/docs/create-short-lived-credentials-direct#sa-credentials-oauth)."]]