了解 DAI Pod Serving API
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助广告连播投放,您可以使用 Google 广告执行服务器端广告插播,而无需将内容发送到 Google 的 DAI 服务器。您可以与您现有的视频技术合作伙伴合作来操控您的清单,或者使用 DAI Pod Serving API(直播或 VOD)实现您自己的清单操纵服务器。
您可以使用互动式媒体广告 (IMA) DAI SDK 为 Web 平台和移动平台开发可与 DAI Pod Serving API 无缝互动的客户端应用。如需使用 DAI Pod Serving API 配置 IMA DAI SDK,请参阅适用于直播或 VOD 视频流格式的客户端应用平台(Android、Chromecast、HTML5、iOS、Roku、tvOS)专用的指南。
如果您有 IMA DAI SDK 不支持的特殊要求,您可以按照客户端视频播放器指南(直播或 VOD)开发自己的客户端应用。
DAI 广告连播投放组件
DAI Pod Serving API 的实现由三个主要组件组成:
Google Ad Manager
Google Ad Manager 是一项托管服务,可用于创建和管理用户流会话、选择要投放的广告、将其编码为流式片段,并在收到请求时将其投放到客户端视频播放器。
在直播中,当客户端视频播放器请求特定片段时,广告会实时插入,并作为这些媒体片段的网址重定向传送到播放器。
在 VOD 视频流中,系统会在开始播放之前选择广告,然后将广告作为一组与每个广告连播对应的视频流清单传送到清单操纵器。
清单操纵器
清单操纵器是一种服务器,它从客户端视频播放器接收视频流会话 ID,使用该 ID 将广告与该视频流相关联,然后将这些广告嵌入视频流清单中。
对于 HLS 直播活动,清单操纵器不会直接与 Ad Manager 通信,而是会将广告媒体片段和 Ad Manager 网址放在视频流清单中,以便客户端视频播放器请求广告媒体片段文件。
对于 VOD 视频流,清单操纵器直接与 Ad Manager 通信以请求广告,并接收一组流式传输清单以与内容流合并。然后,系统会将合并后的清单发送到客户端视频播放器进行播放。
客户端视频播放器
客户端视频播放器是指最终播放包含广告的视频流的应用或网站。在执行此操作之前,它会从 Ad Manager 请求数据流 ID,然后将该 ID 传递给清单操纵器,以接收要播放的流式传输清单。它还负责监控插播视频元数据和触发广告跟踪事件。
直播与 VOD 广告连播投放
乍一看,直播与 VOD 广告连播投放可能看起来非常相似。
但是,这两个工作流程之间存在一些显著差异。
直播广告连播投放 |
VOD 广告连播投放 |
客户端视频播放器在整个播放过程中根据需要从 Ad Manager 请求广告。您可以使用广告插播提前通知预先选择这些广告。
|
清单操纵器会在开始播放前从 Ad Manager 请求所有广告。
|
对于 HLS 视频流,清单操纵器不会直接与 Ad Manager 互动,而是生成广告细分网址,以供客户端视频播放器根据需要请求。
|
在为客户端视频播放器生成流清单之前,清单操纵器会直接向 Ad Manager 请求广告。 |
如果广告连播时长短于指定的广告插播时间点,Ad Manager 可能会插入可选广告。
|
不需要也不支持可选广告。
|
您必须先向 Ad Manager 注册直播活动和编码配置文件,然后才能请求广告。
|
您无需在 Ad Manager 中执行任何设置即可请求广告,但清单操纵器必须针对每个广告请求为您的视频流提供相关编码配置文件和广告代码。 |
在进行直播或 VOD Pod 投放时,请务必注意这些差异。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[null,null,["最后更新时间 (UTC):2025-08-21。"],[[["\u003cp\u003eDAI pod serving enables server-side ad insertion with Google Ads without sending content to Google's servers, allowing flexibility with existing video partners or custom manifest manipulation.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can utilize the IMA DAI SDK for seamless integration across various platforms or follow client video player guides for custom app development.\u003c/p\u003e\n"],["\u003cp\u003eThe DAI pod serving architecture involves three core components: Google Ad Manager, a manifest manipulator (handling ad insertion in stream manifests), and the client video player (for playback and ad tracking).\u003c/p\u003e\n"],["\u003cp\u003eLivestream and VOD pod serving differ in how ads are requested and inserted: livestream requests ads during playback (potentially using early ad break notifications), while VOD requests all ads upfront.\u003c/p\u003e\n"],["\u003cp\u003eLivestream pod serving may utilize slate for short ad pods and requires pre-registration of events and encoding profiles, while VOD pod serving has no slate and requires ad tag and encoding profile information with each request.\u003c/p\u003e\n"]]],[],null,["# Learn DAI Pod Serving API\n\n[Pod serving](//support.google.com/admanager/answer/10492367) lets you perform\nserver-side ad insertion with Google ads, without sending your content to\nGoogle's DAI servers. You can work with your existing Video Technical\nPartner to manipulate your manifest or implement your own manifest manipulation\nserver using the DAI Pod Serving API\n([Live](/ad-manager/dynamic-ad-insertion/api/pod-serving/live) or\n[VOD](/ad-manager/dynamic-ad-insertion/api/pod-serving/vod)).\n\nYou can use the Interactive Media Ads (IMA) DAI SDK to develop client apps for\nthe web and mobile platforms that seamlessly interact with the DAI Pod Serving\nAPI. To configure the IMA DAI SDK with DAI Pod Serving API, refer to the guide\nthat's specific to your client app's platforms (Android, Chromecast, HTML5, iOS,\nRoku, tvOS) for Live or VOD stream format.\n\nIf you have special requirements that are not supported by the IMA DAI SDK, you\ncan follow the client video player guide\n([Live](/ad-manager/dynamic-ad-insertion/api/pod-serving/live/client) or\n[VOD](/ad-manager/dynamic-ad-insertion/api/pod-serving/vod/client)) to develop\nyour own client apps.\n\nDAI pod serving components\n--------------------------\n\nAn implementation of the DAI Pod Serving API consists of three main components:\n\n### Google Ad Manager\n\nGoogle Ad Manager is a hosted service that creates and manages user stream\nsessions, selects ads to serve, encodes them as streaming segments, and delivers\nthem to the client video player when requested.\n\nIn live streams, ads are inserted in real time when specific segments are\nrequested by the client video player and are delivered to the player as URL\nredirects for those media segments.\n\nIn VOD streams, ads are selected before playback begins and are delivered to\nthe manifest manipulator as a set of stream manifests corresponding to each\nad pod.\n\n### Manifest manipulator\n\nA manifest manipulator is a server that receives a stream session ID from\nthe client video player, uses it to associate ads with that stream, and\nembed those ads into the stream manifest.\n\nFor HLS live streams, the manifest manipulator doesn't communicate directly\nwith Ad Manager. Instead, it places ad media segments in the stream manifest\nwith Ad Manager URLs so that the client video player can request the ad media\nsegment files.\n\nFor VOD streams, the manifest manipulator communicates directly with Ad Manager\nto request ads, and receives a set of streaming manifests to merge with the\ncontent stream. The combined manifest is then sent to the client video player\nfor playback.\n\n### Client video player\n\nThe client video player is the app or website that eventually plays back the\nvideo stream containing ads. Before doing so, it requests a stream ID from\nAd Manager and then passes that ID to the manifest manipulator to receive a\nstreaming manifest to play. It's also in charge of watching for in-stream\nmetadata and triggering ad tracking events.\n\nLivestream versus VOD pod serving\n---------------------------------\n\nAt a glance, livestream and VOD pod serving might appear very similar.\nHowever, there are several significant differences between the two workflows.\n\n| Livestream pod serving | VOD pod serving |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| The client video player requests ads from Ad Manager as needed throughout playback. These ads can be preselected using *early ad break notifications*. | The manifest manipulator requests all ads from Ad Manager before playback begins. |\n| With HLS streams, the manifest manipulator doesn't directly interact with Ad Manager, but instead generates ad segment URLs for the client video player to request as needed. | The manifest manipulator directly requests ads from Ad Manager before generating the stream manifest for the client video player. |\n| Ad Manager might insert slate if an ad pod is shorter than a specified ad break. | Slate is not needed or supported. |\n| You must register the livestream event and encoding profiles with Ad Manager before ads can be requested. | You don't need to perform any setup in Ad Manager before ads can be requested, but the manifest manipulator must provide the relevant encoding profiles and ad tag for your stream on each ad request. |\n\nIt's important to keep these differences in mind as you proceed with\n[Live](/ad-manager/dynamic-ad-insertion/api/pod-serving/live) or\n[VOD](/ad-manager/dynamic-ad-insertion/api/pod-serving/vod) pod serving."]]