ima-dai-sdk

Integrates Google IMA DAI SDK for HLS and DASH ad-inserted streams across web, mobile, and TV platforms.

19.1k|1.5k|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/google/skills --skill ima-dai-sdk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ima-dai-sdk
Source: https://github.com/google/skills/tree/main/skills/ads/ima-dai-sdk
Command: npx skills add https://github.com/google/skills --skill ima-dai-sdk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Integrating Google's Interactive Media Ads (IMA) Dynamic Ad Insertion (DAI) SDK requires platform-specific code for requesting livestream and VOD streams, handling timed metadata, and managing ad events, which is error-prone without guidance.

Core Features & Use Cases

  • Multi-platform integration guides: Covers Web/HTML5, Android (ExoPlayer Media3), iOS/tvOS (AVPlayer), Chromecast (CAF Web Receiver), and Roku SceneGraph.
  • Livestream and VOD stream requests: Shows how to build stream requests using Google Ad Manager network codes, asset keys, CMS content source IDs, and video IDs.
  • Event and metadata handling: Details timed metadata forwarding (ID3 for HLS, custom events for DASH), ad break events, and SDK cleanup.
  • Use Case: A developer building an Android video app needs to play a Google DAI livestream; the Skill provides the ExoPlayer IMA extension setup, AdsLoader configuration, and stream URI construction code.

Quick Start

Use the ima-dai-sdk skill to integrate Google DAI livestream playback into my web app with an HTML5 video element.

Frequently Asked Questions about ima-dai-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Google IMA DAI SDK into a web app?

Load the ima3_dai.js script, create a StreamManager with your video element and ad UI div, then request a stream using LiveStreamRequest with an asset key or VODStreamRequest with a content source ID and video ID from Google Ad Manager.

How to play Google DAI streams on Android with ExoPlayer?

Add the media3-exoplayer-ima dependency, build an ImaServerSideAdInsertionMediaSource.AdsLoader with your PlayerView, and set a MediaItem using ImaServerSideAdInsertionUriBuilder with your network code and asset key.

Does IMA DAI SDK support both HLS and DASH formats?

Yes, the SDK supports both HLS and DASH streams. HLS is the default format; for DASH, explicitly set the format property to 'dash' on the stream request object.

Can I use IMA DAI SDK to play VAST or VMAP ad URLs?

No, this integration approach is only for Google full-service DAI livestream and VOD streams. Loading VAST or VMAP URLs requires the client-side IMA SDK instead of the DAI stream request workflow.

Why is timed metadata forwarding required for DAI streams?

The SDK needs timed metadata (ID3 frames for HLS or custom events for DASH) to trigger ad events and track ad breaks. You must listen to player events and pass metadata to streamManager.processMetadata for proper ad playback.