ORTB
OMID 分册导航

AdEvents 与 MediaEvents

接口

本页清单由 scripts/gen-omid-spec.mjs 自 IAB Tech Lab 官方源生成,描述为官方英文原文;采集基线见页尾。 规范收录数据保留英文原文;已提供的中文译文为初稿(draft),打开中英对照可查看原文。

本页目录

定位与职责

事件注册分两类:AdEvents 承载曝光(impressionOccurred)与素材加载完成(loaded,可附 VastProperties);MediaEvents 承载 14 个媒体播放事件(start、三个四分位、complete、pause、resume、bufferStart、bufferFinish、skipped、volumeChange、playerStateChange、adUserInteraction)。事件类型常量见 AdEventType 枚举,其中多数与 VAST 追踪事件一一对应。

所属客户端
会话客户端
库版本
1.6.10
对象
AdEvents · MediaEvents
公开成员
17

AdEvents(曝光与素材加载)

AdEventsjs · 3

广告事件 API:供 JS 组件在关键事件发生时向所有验证提供方(verification provider)发出信号。OM SDK JS 服务只允许一个广告事件实例与广告会话关联,创建多个实例将导致错误。ENAd event API enabling the JS component to signal to all verification providers when key events have occurred. The OM SDK JS service will allow only one ad events instance to be associated with the ad session and any attempt to create multiple instances will result in an error.译稿校对中

名称签名返回官方描述
AdEventsnew AdEvents(adSession)void(官方未提供描述)
  • adSession: AdSessionThe ad session instance for sending events.
impressionOccurredimpressionOccurred()void通知所有验证提供方应记录一次曝光(impression)事件。ENNotifies all verification providers that an impression event should be recorded.译稿校对中
loadedloaded(vastProperties)void通知所有验证提供方应记录一次 loaded 事件。视频/音频创意应传入非 null 的 vastProperties;展示(display)创意应传入 null 参数。ENNotifies all verification providers that a loaded event should be recorded. Video/audio creatives should supply non-null vastProperties. Display creatives should supply a null argument.译稿校对中
  • vastProperties: VastPropertiescontaining static information about the video placement. This is non-null for video/audio creatives and null for display creatives.
docs.iabtechlab.com/omsdk-1.6/js/AdEvents.html

MediaEvents(媒体播放事件)

MediaEventsjs · 14

提供受支持的 JS 媒体事件的完整列表。使用该事件 API 意味着媒体播放器全权负责在恰当时机上报所有媒体事件。同一广告会话只能关联一个媒体事件实现,创建多个实例将导致错误。该规则同时适用于两种情形:创建多个 JS 媒体事件实例,以及在原生实例已通过原生桥(native bridge)注册后再注册 JS 媒体事件实例。ENProvides a complete list of supported JS media events. Using this event API assumes the media player is fully responsible for communicating all media events at the appropriate times. Only one media events implementation can be associated with the ad session and any attempt to create multiple instances will result in an error. The same rules apply to both multiple JS media events and any attempt to register a JS media events instance when a native instance has already been registered via the native bridge.译稿校对中

名称签名返回官方描述
MediaEventsnew MediaEvents(adSession)void(官方未提供描述)
  • adSession: AdSessionThe ad session instance for sending events.
adUserInteractionadUserInteraction(interactionType)void通知所有媒体监听器(media listener):用户已执行了一次广告交互。ENNotifies all media listeners that the user has performed an ad interaction.译稿校对中
  • interactionType: InteractionTypeThe latest user interaction.
bufferFinishbufferFinish()void通知所有媒体监听器:缓冲已结束且媒体播放已恢复。ENNotifies all media listeners that buffering has finished and media playback has resumed.译稿校对中
bufferStartbufferStart()void通知所有媒体监听器:媒体播放已停止并开始缓冲。ENNotifies all media listeners that media playback has stopped and started buffering.译稿校对中
completecomplete()void通知所有媒体监听器:媒体播放已完成。ENNotifies all media listeners that media playback is complete.译稿校对中
firstQuartilefirstQuartile()void通知所有媒体监听器:媒体播放已到达第一四分位(first quartile)。ENNotifies all media listeners that media playback has reached the first quartile.译稿校对中
midpointmidpoint()void通知所有媒体监听器:媒体播放已到达中点(midpoint)。ENNotifies all media listeners that media playback has reached the midpoint.译稿校对中
pausepause()void通知所有媒体监听器:媒体播放已在一次用户交互后暂停。ENNotifies all media listeners that media playback has paused after a user interaction.译稿校对中
playerStateChangeplayerStateChange(playerState)void通知所有媒体监听器:媒体播放器状态已发生变化。ENNotifies all media listeners that media player state has changed.译稿校对中
  • playerState: VideoPlayerStateThe latest media player state.
resumeresume()void通知所有媒体监听器:媒体播放已在一次用户交互后(从暂停状态)恢复。ENNotifies all media listeners that media playback has resumed (after being paused) after a user interaction.译稿校对中
skippedskipped()void通知所有媒体监听器:媒体播放已因用户的跳过(skip)交互而停止。媒体一旦被跳过,就不应再恢复播放内容。ENNotifies all media listeners that media playback has stopped as a user skip interaction. Once skipped media it should not be possible for the media to resume playing content.译稿校对中
startstart(duration, mediaPlayerVolume)void通知所有媒体监听器:媒体内容已开始播放。ENNotifies all media listeners that media content has started playing.译稿校对中
  • duration: numberDuration of the selected media media (in seconds).
  • mediaPlayerVolume: numberAudio volume of the media player with a range between 0 and 1.
thirdQuartilethirdQuartile()void通知所有媒体监听器:媒体播放已到达第三四分位(third quartile)。ENNotifies all media listeners that media playback has reached the third quartile.译稿校对中
volumeChangevolumeChange(mediaPlayerVolume)void通知所有媒体监听器:媒体播放器已改变音量。ENNotifies all media listeners that the media player has changed the volume.译稿校对中
  • mediaPlayerVolume: numberAudio volume of the media player with a range between 0 and 1.
docs.iabtechlab.com/omsdk-1.6/js/MediaEvents.html

与 VAST 追踪事件的对应

常量字面值官方描述
IMPRESSIONimpressionOMID 提供方已为本次广告记录曝光。对视频广告而言,该事件对应 VAST 的 <Impression>,应与其同时触发。ENThe OMID provider has recorded an impression for this ad. For video ads, this corresponds to the VAST <Impression> and should be fired simultaneously with that event. Constant has value 'impression'.译稿校对中
LOADEDloadedOM 集成方已加载展示、视频或音频广告创意的素材。对视频与音频广告而言,创意媒体已缓冲至可随即播放的程度。对应 VAST 的 'loaded' 事件。ENThe OM integration has loaded the display, video, or audio ad creative's assets. For video and audio ads, it has buffered the creative’s media to the extent that it is ready to play the media. Corresponds to the VAST 'loaded' event. Constant has value 'loaded'.译稿校对中
STARTstart仅媒体(media-only)事件。播放器开始播放视频广告创意。对应 VAST 的 'start' 事件。ENMedia-only event. The player began playback of the video ad creative. Corresponds to the VAST 'start' event. Constant has value 'start'.译稿校对中
FIRST_QUARTILEfirstQuartile仅媒体(media-only)事件。创意已连续播放至少达到总时长的 25%。对应 VAST 的 'firstQuartile' 事件。ENMedia-only event. The creative played continuously for at least 25% of the total duration. Corresponds to the VAST 'firstQuartile' event. Constant has value 'firstQuartile'.译稿校对中
MIDPOINTmidpoint仅媒体(media-only)事件。创意已连续播放至少达到总时长的 50%。对应 VAST 的 midpoint 事件。ENMedia-only event. The creative played continuously for at least 50% of the total duration. Corresponds to the VAST midpoint event. Constant has value 'midpoint'.译稿校对中
THIRD_QUARTILEthirdQuartile仅媒体(media-only)事件。创意已连续播放至少达到总时长的 75%。对应 VAST 的 'thirdQuartile' 事件。ENMedia-only event. The creative played continuously for at least 75% of the total duration. Corresponds to the VAST 'thirdQuartile' event. Constant has value 'thirdQuartile'.译稿校对中
COMPLETEcomplete仅媒体(media-only)事件。创意已播放至结尾,达到总时长的 100%。对应 VAST 的 'complete' 事件。ENMedia-only event. The creative played to the end for 100% of the total duration. Corresponds to the VAST 'complete' event. Constant has value 'complete'.译稿校对中
PAUSEpause仅媒体(media-only)事件。因用户交互,播放以之后可恢复的方式停止。对应 VAST 的 'pause' 事件。ENMedia-only event. Playback was stopped in a way from which it may later be resumed, due to user interaction. Corresponds to the VAST 'pause' event. Constant has value 'pause'.译稿校对中
RESUMEresume仅媒体(media-only)事件。在由用户发起的暂停之后,播放恢复。对应 VAST 的 'resume' 事件。ENMedia-only event. Playback resumed following a user-originated pause. Corresponds to the VAST 'resume' event. Constant has value 'resume'.译稿校对中
SKIPPEDskipped仅媒体(media-only)事件。用户触发了某个控件,导致广告播放终止。对应 VAST 的 'skip' 事件。ENMedia-only event. The user activated a control which caused ad playback to terminate. Corresponds to the VAST 'skip' event. Constant has value 'skipped'.译稿校对中

下表按 AdEventType 官方描述中显式点名 VAST 事件的取值筛出,对应关系取自官方描述原文,本站不另行推断;描述中未点名 VAST 的事件(bufferStart、bufferFinish、volumeChange、playerStateChange、adUserInteraction)不在表内。

跨平台命名对照

概念JavaScriptiOSAndroid
ad-eventsAdEventsOMIDAdEventsAdEvents
media-eventsMediaEventsOMIDMediaEventsMediaEvents
vast-propertiesOMIDVASTPropertiesVastProperties
  • vast-propertiesJS 侧 VastProperties(src/common/vast-properties.js,标 @public 且在 jsdoc.json 的 include 列表内)未被官方 JSDoc 站点发布(VastProperties.html 实测 404),故 js 记 null;AdEvents.loaded(vastProperties) 因此引用了一个站点上没有文档的类型。

同一概念在三端的类名对照;空缺表示该端不提供对应类。JS 侧把会话配置折进 Context 与构造参数,iOS / Android 侧则拆为独立的配置与上下文类。

内容取自 IAB Tech Lab 官方源(OM SDK JS 仓库、三端官方 API 文档、OpenRTB 支持通告与 VAST 规范);规范收录数据保留英文原文,站内撰写文案为中英双语。溯源见 data/omid-spec/PROVENANCE.json。