ima-sdk-client-side
它能做什么
它会说明如何根据 VAST 或 VMAP 请求加载插播式视频和音频广告,并在广告前后控制播放。适合希望在网页、移动或电视的自有视频播放器中展示广告的开发者。
适用场景
- ✓当你想在网站或应用中加入片头或中插视频广告时。
- ✓当你的广告服务器返回 VAST 或 VMAP 广告响应时。
- ✓当你需要在 Android、iOS 或电视应用中加入视频广告时。
技能链接
https://github.com/google/skills/blob/main/skills/ads/ima-sdk-client-side/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请使用我广告服务器提供的 VAST 标签,在我的网站播放器中加入片头视频广告。”
每周 5 个新技能,1 分钟读完。
工作原理
它会阅读你所用平台的指南,设置 SDK,针对某个用户操作发起广告请求,处理加载成功或失败的情况,并管理广告播放。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
IMA SDK client-side
The Google IMA SDK (Interactive Media Ads) lets you load in-stream video and audio ads into websites, apps, TVs and other digital platforms. Use an IMA SDK to request ads from any VAST-compliant ad server and manage ad playback.
Prerequisites
Before integrating the IMA SDK, you must read the platform-specific guide below to support all platforms that your app can support:
- Web/HTML5/ReactJs/NodeJs/Angular: Read all these guides ima-sdk-web-guide.md, ima-sdk-web-iframe-mode.md, ima-sdk-web-mobile-safari.md
- Android/AndroidTV/ReactNative: Read ima-sdk-android-guide.md
- iOS/tvOS/ReactNative: Read all these guides ima-sdk-ios-guide.md, ima-sdk-tvos-guide.md
Quick start (general workflow)
- Import the SDK: Prerequisites, dependencies.
- Initialization: Early setup, Warmup, Settings Configuration, and Ad UI Setup.
- Ad Request: Creating and triggering the request, User gesture compliance.
- Ad Load Success/Failure: Handling the load event to get the AdsManager, or handling early fatal errors.
- Ad Playback Events: Listening to playback events via AdsManager to coordinate content play/pause, and handling non-fatal LOG events and fatal active playback errors.
- Cleanup: Properly destroying the AdsManager to release resources and prevent memory leaks.
For detailed, platform-specific implementation details, always refer to the guides in the Prerequisites section.
常见问题
它涵盖服务端广告插入吗?
不涵盖。动态广告插入、SSAI 和 SGAI 不在本技能范围内。
它覆盖哪些平台?
网页、Android、Android TV、React Native、iOS 和 tvOS。
它会处理用户手势吗?
会。它的广告请求指南涵盖用户手势的合规要求。
详情
作者的原始描述
Supports Interactive Media Ads (IMA) SDK. Use this skill for client-side ad insertion when you are requesting video ads for websites, apps, TVs or other platforms using VAST or VMAP. Do not use for Dynamic Ad Insertion (DAI), SSAI, or SGAI.
repo: google/skills
热度
- GitHub 星标
- 22k
- 排名
- #10195
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
finding-google-skills
22k帮你的智能体为某项设置任务找到合适的 Google 指南,例如托管、数据库、存储、登录或 AI 模型服务。
gcloud
22k帮你的智能体编写并检查 Google Cloud gcloud 命令,在运行任何内容之前查阅准确的语法,避免猜测参数。
google-cloud-recipe-auth
22k引导你的智能体了解 Google Cloud 的身份与访问管理,包括人员和服务如何登录,以及它们各自获得哪些权限。
google-cloud-recipe-onboarding
22k带领新开发者完成在 Google Cloud 上的第一步,包括选择项目、关联计费,以及部署第一个资源。