Integrates the Google Interactive Media Ads (IMA) Dynamic Ad Insertion (DAI) SDK into websites, web apps, mobile apps, or TV apps. Use when: - A video player needs to load and play HLS or DASH streams in web apps, Android apps, iOS apps, tvOS apps, Cast (CAF) receivers, or Roku channels. - The app needs to make use of a Google DAI livestream event asset key, or content source CMS ID, video ID for video on demand. Don't use this skill to load and play a VAST or VMAP URL.
指導在網頁、行動裝置、Cast 與 Roku 平台上整合 Google IMA 動態廣告插入 SDK,以載入 HLS 或 DASH 串流。
功能
此技能提供各平台專屬的指引,用於將 Google Interactive Media Ads(IMA)動態廣告插入(DAI)SDK 整合至影片播放器。內容涵蓋為直播活動與隨選影片內容載入 HLS 或 DASH 串流,並說明通用流程:匯入並初始化 SDK、加入串流事件監聽器、轉送計時中繼資料、發出串流請求,以及在串流失敗或使用者離開時清理資源。它也會引導讀者查閱 Web、Cast、Android、iOS/tvOS 與 Roku 的參考指南。
適用情境
當影片播放器需要在網頁應用程式、Android、iOS、tvOS、Cast 接收器或 Roku 頻道中載入並播放 HLS 或 DASH 串流時使用。當應用程式需要使用 Google DAI 直播活動資產金鑰,或用於隨選影片的內容來源 CMS ID、影片 ID 時也適用。它不適用於載入與播放 VAST 或 VMAP URL。
執行需求
僅為說明文件,未隨附指令碼。需要目標平台對應的 Google IMA DAI SDK,以及存取在 Google Ad Manager 中設定的直播活動或已匯入的隨選內容。隨附的參考指南用於查閱各平台的具體整合細節。
IMA DAI SDK
Use the IMA DAI SDK to load HLS or DASH streams into the app for:
Livestream events configured in Google Ad Manager.
Video on demand (VOD) content ingested into Google Ad Manager.
Prerequisites
Review the platform-specific integration guides for the target platforms:
Web/HTML5/ReactJs/NodeJs/Angular: Read
StreamManager guide [blocked] for loading
stream URL from Google full-service DAI into <video> element.
ChromeCast: Read
StreamManager guide [blocked] for
integrating the IMA DAI SDK into a ChromeCast Web Receiver.
Android: Read
ImaServerSideAdInsertionMediaSource guide [blocked]
for integrating Media3 Exoplayer IMA extension.
iOS/tvOS: Read
IMAStreamRequest guide [blocked] for
playing streams with AVPlayer.
Roku: Read StreamManager guide [blocked]
for implementing DAI on Roku SceneGraph.
Quick start (general workflow)
Import the SDK
Initialize the SDK
Add stream event listeners
Set up timed metadata forwarding
Make a stream request
Clean up SDK resources when the stream fails or the user leaves the stream.