直播概览
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Pod Serving API 可让您访问自适应比特率的视频广告连播,这种广告连播采用的方式可以直接拼接到面向用户的 HLS 或 MPEG DASH 媒体播放列表中。
此 API 面向高级发布商和视频技术合作伙伴。
要大规模使用此 API,您需要设计和实现复杂的媒体传送工作流程,这不在本文档的讨论范围内。
前提条件
在通过 DAI Podserving API 处理直播活动之前,您需要使用 Google Ad Manager 界面或直播活动 API 创建直播活动。
组件
Pod Serving API 的任何实现都由三个组件构成:Google Ad Manager、客户端视频播放器和清单操纵服务器。

Ad Manager
Ad Manager 负责向用户投放广告,并可通过 Ad Manager SDK 或其网页界面进行管理。该服务具有以下责任:
- 接收来自客户端视频播放器的视频流请求、确定广告并提供与内容编码配置文件匹配的呈现
- 响应来自客户端视频播放器的广告细分请求,并为指定用户提供广告连播的相应部分
- 接收和处理来自客户端视频播放器的跟踪 ping
客户端视频播放器
客户端视频播放器是指客户端用来播放生成的视频流的应用或网站。玩家有以下责任:
- 初始化 Ad Manager 中的视频流资源,并接收代表特定直播活动的单个播放会话的视频流对象。
- 从清单操纵服务器请求流清单,该清单将开始播放
- 定期从 Ad Manager 轮询广告连播元数据,这些元数据用于描述视频流广告细分受众群中嵌入的广告事件
- 监听由包含广告媒体 ID 的播放器引发的定时元数据事件。遇到这些事件后,播放器会将其转发给 Ad Manager,以验证广告事件是否已成功发生。
如需详细了解客户端视频播放器的正确实现,请参阅适用于您平台的广告连播投放指南:
如需了解自定义实现,请参阅 DAI API 的 Pod 投放客户端指南。
清单操纵服务器
清单操纵服务器是负责托管提供给客户端视频播放器的流清单的服务器。服务器具有以下责任:
- 处理向客户端视频播放器交付清单的操作
- 从 Ad Manager 请求时间段模板(仅适用于 MPEG DASH 数据流),以便填充广告片段。
- 在广告插播期间,将 Ad Manager 托管的广告片段网址插入到视频流清单(对于 HLS)或广告时段(对于 MPEG DASH)中。
- 将修改后的清单投放到客户端视频播放器。
如需详细了解如何实现自定义清单操纵器服务器,请参阅清单操纵指南。
术语库
- 直播活动:用于存储直播活动的重要配置数据(例如编码配置文件)的事件。直播活动是使用 Ad Manager 创建的。
- 流对象:表示特定视频资产的单个播放会话的对象。值得注意的属性包括视频流 ID 和媒体验证网址。
- 广告连播:对广告插播时间点中显示的广告视频进行分组
- 广告片段:广告插播时间点的媒体片段文件
- 广告连播元数据:用于在客户端呈现广告界面的广告插播时间点的元数据;例如,在广告播放期间隐藏跳转按钮
- 广告媒体 ID:在广告细分文件中编码为 ID3 代码的元数据。此元数据用于标识在播放过程中何时发生与广告相关的特定事件,例如广告开始播放或播放中点。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-01。
[null,null,["最后更新时间 (UTC):2025-08-01。"],[[["\u003cp\u003eThe Pod Serving API facilitates the integration of adaptive-bitrate video ad pods directly into HLS or MPEG DASH media playlists for advanced publishers and video technology partners.\u003c/p\u003e\n"],["\u003cp\u003eImplementing the Pod Serving API involves three core components: Google Ad Manager, which handles ad delivery and tracking; a client video player, which manages stream initialization and playback; and a manifest manipulation server, which modifies and serves the stream manifest.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the API, a livestream event must be created via the Google Ad Manager UI or the live-event API, serving as a configuration resource for the livestream.\u003c/p\u003e\n"],["\u003cp\u003eThe client video player is responsible for initializing the stream, requesting the manifest, polling for ad pod metadata, and forwarding timed metadata events to Ad Manager.\u003c/p\u003e\n"],["\u003cp\u003eThe manifest manipulation server handles manifest delivery, requests ad period templates, and inserts Ad Manager-hosted ad segment URLs or ad periods into the stream manifest during ad breaks.\u003c/p\u003e\n"]]],[],null,["# Overview for live streams\n\nThe Pod Serving API provides access to adaptive-bitrate video ad pods prepared\nin such a way that they can be stitched directly into a user-facing HLS or MPEG\nDASH media playlist.\n\nThis API is intended for advanced publishers and video technology partners.\nUsing this API at scale requires design and implementation of a sophisticated\nmedia serving workflow which is outside the scope of this documentation.\n\nPrerequisites\n-------------\n\nBefore processing a livestream through the DAI Podserving API, you\nwill need to create a\n[livestream event](/ad-manager/dynamic-ad-insertion/api/pod-serving/live/manipulator#livestreamevent)\nusing the Google Ad Manager UI, or the live-event API.\n\nComponents\n----------\n\nThere are three components that make up any implementation of the Pod Serving\nAPI: Google Ad Manager, a client video player, and a manifest manipulation\nserver.\n\n### Ad Manager\n\nAd Manager is responsible for delivering ads to the user and can be managed\nthrough either the Ad Manager SDK or its web interface. The service has these\nresponsibilities:\n\n- Receiving stream requests from the client video player, decisioning ads, and providing renditions to match your content encoding profiles\n- Responding to ad segment requests from the client video player and providing the appropriate portion of the ad pod for the given user\n- Receiving and processing tracking pings from the client video player\n\n### Client video player\n\nThe client video player is the app or website that clients use to play the\nresulting video stream. The player has these responsibilities:\n\n- Initializing a stream resource from Ad Manager and receiving a stream object that represents a single playback session of a specific livestream event.\n- Requesting a stream manifest from the manifest manipulation server, which starts playback\n- Periodically polling ad pod metadata from Ad Manager that describes the ad events embedded in the stream's ad segments\n- Listening for timed metadata events raised by the player that contain ad media IDs. Upon encountering these events, the player forwards them to Ad Manager to verify that ad events have successfully occurred.\n\nTo learn more about the proper implementation of the client video player, see\nthe pod serving guide for your platform:\n\n- [Android](/ad-manager/dynamic-ad-insertion/sdk/android?service=pod)\n- [HTML5](/ad-manager/dynamic-ad-insertion/sdk/html5?service=pod)\n- [iOS](/ad-manager/dynamic-ad-insertion/sdk/ios?service=pod)\n- [tvOS](/ad-manager/dynamic-ad-insertion/sdk/tvos?service=pod)\n\nFor custom implementations, see our [pod serving client guide for the DAI\nAPI](/ad-manager/dynamic-ad-insertion/api/pod-serving/live/client).\n\n### Manifest manipulation server\n\nThe manifest manipulation server is the server in charge of hosting the\nstream manifest provided to the client video player. The server has these\nresponsibilities:\n\n- Handling manifest delivery to the client video player\n- Requesting a period template from Ad Manager (for MPEG DASH streams only), to populate with ad segments.\n- Inserting Ad Manager-hosted ad segment URLs into the video stream manifest (for HLS) or ad period (for MPEG DASH) during ad breaks.\n- Serving the modified manifest to the client video player.\n\nTo learn more about implementing a custom manifest manipulator server, see the\n[manifest manipulation\nguide](/ad-manager/dynamic-ad-insertion/api/pod-serving/live/manipulator).\n\nGlossary\n--------\n\n- **Livestream event**: An event that stores important configuration data for livestream, such as encoding profiles. Livestream events are created using Ad Manager.\n- **Stream object**: An object that represents a single playback session of a specific video asset. Notable properties include the stream ID and the media verification URL.\n- **Ad pod**: Grouping of ad videos shown in an ad break\n- **Ad segments**: Media segment files for the ad break\n- **Ad pod metadata**: Metadata for the ad break used to render ad UI on the client; for example, hide seek buttons during ad\n- **Ad media ID**: Metadata encoded as ID3 tags within ad segment files. This metadata is used to identify when specific ad-related events have occurred during playback, such as ad start or midpoint."]]