瞭解 DAI Pod Serving API
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
廣告連播放送可讓您在 Google Ads 執行伺服器端廣告插播,不必將內容傳送至 Google 的 DAI 伺服器。您可以與現有的影片技術合作夥伴合作,以運用 DAI Pod Serving API (直播或 VOD) 來操控資訊清單,或導入自己的資訊清單操控伺服器。
您可以使用互動式媒體廣告 (IMA) DAI SDK 開發適用於網頁和行動平台的用戶端應用程式,以便與 DAI Pod 放送 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 Pod 放送看起來非常相似。
不過,這兩個工作流程之間存在一些重大差異。
直播活動廣告連播放送 |
隨選影片廣告連播放送 |
用戶端影片播放器會在播放期間視需要向 Ad Manager 請求廣告。您可以使用早期廣告插播通知預先選取這類廣告。 |
資訊清單操控器在開始播放前,向 Ad Manager 請求所有廣告。 |
使用 HLS 串流時,資訊清單操控程式不會直接與 Ad Manager 互動,而是產生廣告區隔網址,讓用戶端影片播放器視需要發出請求。 |
資訊清單操控器會先向 Ad Manager 直接請求廣告,然後再為用戶端影片播放器產生串流資訊清單。 |
如果廣告連播比指定的廣告插播時段短,Ad Manager 可能會插入插入畫面。 |
不需要或不支援插入畫面。 |
您必須先向 Ad Manager 註冊直播活動和編碼設定檔,才能請求廣告。 |
您不需要在 Ad Manager 中設定任何廣告,即可發出廣告請求,但資訊清單操控程式必須針對每個廣告請求,為串流提供相關的編碼設定檔和廣告代碼。
|
處理直播或隨選影片 Pod 時,請務必將這些差異謹記在心。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-21 (世界標準時間)。
[null,null,["上次更新時間: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."]]