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.