ima-sdk-client-side

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

IMA SDK client-side

IMA SDK 客户端

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.
Google IMA SDK(Interactive Media Ads)可帮助您将流式视频和音频广告加载到网站、应用、电视及其他数字平台中。使用IMA SDK可从任何兼容VAST标准的广告服务器请求广告,并管理广告播放。

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

在集成IMA SDK之前,您必须阅读以下平台专属指南,以支持您的应用所覆盖的所有平台:
  • Web/HTML5/ReactJs/NodeJs/Angular: 阅读所有这些指南 ima-sdk-web-guide.md, ima-sdk-web-iframe-mode.md, ima-sdk-web-mobile-safari.md
  • Android/AndroidTV/ReactNative: 阅读 ima-sdk-android-guide.md
  • iOS/tvOS/ReactNative: 阅读所有这些指南 ima-sdk-ios-guide.md, ima-sdk-tvos-guide.md

Quick start (general workflow)

快速入门(通用流程)

  1. Import the SDK: Prerequisites, dependencies.
  2. Initialization: Early setup, Warmup, Settings Configuration, and Ad UI Setup.
  3. Ad Request: Creating and triggering the request, User gesture compliance.
  4. Ad Load Success/Failure: Handling the load event to get the AdsManager, or handling early fatal errors.
  5. 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.
  6. 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.
  1. 导入SDK:完成前提条件准备,安装依赖。
  2. 初始化:提前配置、预热、设置参数及广告UI搭建。
  3. 广告请求:创建并触发请求,符合用户交互规范。
  4. 广告加载成功/失败:处理加载事件以获取AdsManager,或处理早期致命错误。
  5. 广告播放事件:通过AdsManager监听播放事件,协调内容播放/暂停,处理非致命LOG事件及播放中的致命错误。
  6. 清理:正确销毁AdsManager以释放资源,避免内存泄漏。
如需详细的平台专属实现细节,请始终参考前提条件部分中的指南。