ORTB
OMID 分册导航

JavaScript(Web / WebView / CTV)

平台

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

本页目录

定位与职责

OM SDK JS 是 Web、应用内 WebView 与联网电视(Connected TV,CTV)三类场景共用的实现,产出两个 UMD 二进制:omid-session-client-v1.js 由广告 SDK 在构建期并入广告 HTML,omid-verification-client-v1.js 由测量厂商在构建期并入验证脚本。当前库版本 1.6.10。

JavaScript
实现
OM SDK JS
库版本
1.6.10
规范版本
OMID 1.6
公开类
8
公开成员
62

平台要点

  • 构建产出三个 UMD 二进制:omid-session-client-v1.js(集成方在构建期并入广告 HTML)、omid-verification-client-v1.js(测量厂商在构建期并入验证脚本)、omid-compliance-verification-client-v1.js(合规验证脚本)。
  • 三种引入方式:CommonJS(require 后取 OmidVerificationClient)、Google Closure(goog.require('omid.verificationClient.VerificationClient'),需 Closure 编译器 20200112.0.0 或更新版本)、全局(先加载并执行 omid-verification-client-v1.js 使其导出全局,再由验证脚本读取)。
  • OM 服务在 Web 上以 iframe 承载;其他 iframe 通过名为 omid_v1_present 的 iframe 探测 OMID 是否可用,该名称按服务环境分为 omid_v1_present_web(Web)与 omid_v1_present_app(应用内)。官方自 1.5.6 起建议不要对该 iframe 使用 display:none,同期 Web 参考应用改为不使用 iframe。
  • 会话客户端在 Web 顶层与跨域 iframe 中均可工作。AdSession 的官方类描述写明它用于「使集成方能够向既有原生广告会话贡献事件」,并负责处理与 OM SDK JS 服务受限访问的场景(即跨域 iframe);因此 start() 与 finish() 在移动应用环境中无效果。
  • CTV 在同一 JS 实现内扩展:1.4 引入 DeviceCategory 与最后活动时间信号(lastActivityTime),1.5 增加 Samsung Tizen 与 LG webOS 支持(含 appId、deviceInfo 与设备音量检测)并提供 Web CTV 参考应用,1.6 增加 Fire TV 的设备认证。
  • UniversalAdId 与 VastProperties 在源码中经 packageExport 导出到 OmidSessionClient(前者 1.5.5 新增),但官方 JSDoc 站点未发布对应页面;AdEvents.loaded(vastProperties) 因此引用了一个站点上没有文档的类型。

公开类清单

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

AdSessionjs · 12

JS 广告会话 API:供集成方(integration partner)参与已有的原生(native)广告会话。它同时负责与 OM SDK JS 服务通信,并处理只能有限访问 OM SDK JS 服务的场景——即跨域 iframe。本 API 常用于以下场景:视频广告会话依赖 HTML5 视频播放器来注入验证脚本资源(verification script resource)和/或发布 OMID 视频事件;展示(display)广告会话依赖独立的 JS 组件来处理曝光事件。ENThe JS ad session API enabling the integration partner to contribute to an existing native ad session. This is also responsible for communicating to the OM SDK JS service and will also handle scenarios with limited access to the OM SDK JS service - i.e. cross-domain iFrames. This API is commonly used in the following scenarios; - video ad session relying on the HTML5 video player for injecting verification script resources and/or publishing OMID video events. - display ad session relying on a separate JS component to handle the impression event.译稿校对中

名称签名返回官方描述
AdSessionnew AdSession(context, communication, sessionInterface)void(官方未提供描述)
  • context: Contextthat provides the required information for initialising the JS ad session.
  • communication: Communication<?>This parameter is for OM SDK internal use only and should be omitted.
  • sessionInterface: OmidJsSessionInterfaceThis parameter is for OM SDK internal use only and should be omitted.
errorerror(errorType, message)void通报广告会话上发生了错误。所有验证客户端(verification client)都会通过 'sessionError' 会话观察者事件收到通知。ENNotifies that an error has occurred on the ad session. All verification clients will be notified via the 'sessionError' session observer event.译稿校对中
  • errorType: ErrorTypeHigh level error type.
  • message: stringDescription of the session error.
finishfinish()void若当前存在活跃的广告会话,本方法以 SESSION_FINISH 事件通知所有会话观察者广告会话已结束:广告视图跟踪以及向为本会话注入的验证脚本发送消息随之停止。无活跃会话时调用、或在移动应用环境中调用,本方法无效果。ENIf there is a currently active ad session, this notifies all session observers that the ad session has finished with a SESSION_FINISH event. This ceases ad view tracking and message sending to verification scripts injected for the ad session. This method has no effect if called if there is no active ad session or in a mobile app environment.译稿校对中
getAdSessionIdgetAdSessionId()string获取本广告会话的 ID。ENGet the ID of this ad session.译稿校对中
isSupportedisSupported()booleanOMID 可用时返回 true,否则返回 false。ENReturns true if OMID is available, false otherwise.译稿校对中
registerAdEventsregisterAdEvents()void登记一个 AdEvents 实例的存在。ENRegisters the existence of an AdEvent instance.译稿校对中
registerMediaEventsregisterMediaEvents()void登记一个 MediaEvents 实例的存在。ENRegisters the existence of an MediaEvents instance.译稿校对中
registerSessionObserverregisterSessionObserver(functionToExecute)void订阅所有会话事件('sessionStart'、'sessionError'、'sessionFinish')。事件处理器会以单个参数被调用,该参数含以下字段:'adSessionId'(string)、'timestamp'(number)、'type'(string)、'data'(object)。ENSubscribes to all session events ('sessionStart', 'sessionError', and 'sessionFinish'). The event handler will be called with a single argument that has the following fields: 'adSessionId': string, 'timestamp': number, 'type': string, 'data': object译稿校对中
  • functionToExecute: function(Event)An event handler which will be invoked on session events.
setCreativeTypesetCreativeType(creativeType)void指定本会话中将渲染的创意类型。要求原生层已将创意类型设为 DEFINED_BY_JAVASCRIPT。ENSpecifies the type of creative to be rendered in this session. Requires that the native layer set the creative type to DEFINED_BY_JAVASCRIPT.译稿校对中
  • creativeType: CreativeTypeThe type of creative.
setElementBoundssetElementBounds(elementBounds)void设置 DOM 元素的几何信息,其相对基准为 slotElement 的几何信息,或创意 DOM 元素所在跨域 iframe 的几何信息。ENSet the DOM element's geometry relative to the geometry of either the slotElement or the cross domain iframe the creative's DOM element is in.译稿校对中
  • elementBounds: Rectangle
setImpressionTypesetImpressionType(impressionType)void指定本会话中将被触发的曝光类型。要求原生层已将曝光类型设为 DEFINED_BY_JAVASCRIPT。ENSpecifies the type of impression to be triggered in this session. Requires that the native layer set the impression type to DEFINED_BY_JAVASCRIPT.译稿校对中
  • impressionType: ImpressionTypeThe type of impression.
startstart()void若当前没有活跃的广告会话,本方法以 SESSION_START 事件通知所有会话观察者会话已开始:广告视图跟踪随之启动,视频事件与广告事件开始可发送给为本会话注入的验证脚本(verification script)。会话已开始后再次调用、或在移动应用环境中调用,本方法无效果。ENIf there is no currently active ad session, this notifies all session observers that an ad session has started with a SESSION_START event. This starts ad view tracking and makes video and ad events available to send to verification scripts injected for this ad session. This method has no effect if called after the ad session has already started or in a mobile app environment.译稿校对中
docs.iabtechlab.com/omsdk-1.6/js/AdSession.html

Contextjs · 11

保存由 JavaScript 层写入广告会话上下文(ad session context)的信息。ENHolds information provided into the ad session context by the JavaScript layer.译稿校对中

名称签名返回官方描述
Contextnew Context(partner, verificationScriptResources, contentUrl, customReferenceData, universalAdId)void创建新的广告会话上下文,提供集成方(partner)引用以及应由 OM SDK 服务管理的脚本资源列表。ENCreate a new ad session context providing reference to partner and a list of script resources which should be managed by OM SDK service.译稿校对中
  • partner: PartnerThe integration's partner ID and version.
  • verificationScriptResources: Array<VerificationScriptResource>The verification resources to load.
  • contentUrl: stringOn web, the URL of top-level web page. In apps, an optional content URL of the screen within the app that is showing the ad, such as an Android deep link or iOS universal link. Defaults to null.
  • customReferenceData: stringArbitrary reference data the integrator can share with verification scripts. Has no effect in mobile app environment. Defaults to null.
  • universalAdId: UniversalAdId- The UniversalId tag used for creative ID validation. Defaults to null.
contentUrlcontentUrl: stringstring(官方未提供描述)
customReferenceDatacustomReferenceData: stringstring(官方未提供描述)
serviceWindowserviceWindow: WindowWindow若非 null,则为服务通信应定向到的 window,覆盖默认的查找算法。ENIf not null, the window to which service communication should be directed, overriding the default search algorithm.译稿校对中
slotElementslotElement: HTMLElementHTMLElement(官方未提供描述)
underEvaluationunderEvaluation: booleanboolean本广告会话是否处于评估中(under evaluation),其定义见 Open Measurement License for Web Video, V 1.0 中的“Evaluation Flag”。在应用环境中被忽略。默认值为 false。ENWhether or not this ad session is under evaluation, as defined by "Evaluation Flag" in the Open Measurement License for Web Video, V 1.0. Ignored in app environments. Defaults to false.译稿校对中
universalAdIduniversalAdId: UniversalAdIdUniversalAdId(官方未提供描述)
videoElementvideoElement: HTMLVideoElementHTMLVideoElement(官方未提供描述)
setServiceWindowsetServiceWindow(serviceWindow)void默认情况下,OM SDK 会话客户端库(Session Client Library)假定服务脚本(Service Script)位于库自身被加载的同一 frame 中,或位于 top。调用本方法可覆盖该默认行为,改为让库指向所给的 window。ENBy default, the OM SDK Session Client Library will assume the Service Script is present in the same frame the library is loaded in, or top. Call this method to override this default and point the library to the give window instead.译稿校对中
  • serviceWindow: WindowThe window containing the OMID Service Script.
setSlotElementsetSlotElement(slotElement)void指定 WebView 内的广告创意 HTML 元素。ENSpecifies the ad creative HTML element within the WebView.译稿校对中
  • slotElement: HTMLElementThe ad creative DOM element.
setVideoElementsetVideoElement(videoElement)void指定 WebView 内的视频元素。ENSpecifies the video element within the WebView.译稿校对中
  • videoElement: HTMLVideoElementThe video element.
docs.iabtechlab.com/omsdk-1.6/js/Context.html

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

OmidVersionjs · 1

表示 OMID 会话客户端(OMID Session Client)的版本。ENRepresents the Version of OMID Session Client.译稿校对中

名称签名返回官方描述
OmidVersionnew OmidVersion(semanticVersion, apiLevel)void(官方未提供描述)
  • semanticVersion: string
  • apiLevel: string
docs.iabtechlab.com/omsdk-1.6/js/OmidVersion.html

Partnerjs · 1

保存使用会话客户端的集成方(integration partner)信息。ENHolds information about the integration partner that is using the session client.译稿校对中

名称签名返回官方描述
Partnernew Partner(name, version)void以给定的 name 与 version 创建新的集成方(Partner)实例。ENCreates a new partner instance given a name and a version.译稿校对中
  • name: stringThe partner ID of the integration.
  • version: stringThe version of the integration's session script.
docs.iabtechlab.com/omsdk-1.6/js/Partner.html

VerificationClientjs · 14

供验证脚本(verification script)与 OM SDK 服务交互。ENAllows verification scripts to interact with the OM SDK Service.译稿校对中

名称签名返回官方描述
VerificationClientnew VerificationClient(communication)void(官方未提供描述)
  • communication: Communication<?>This parameter is for OM SDK internal use only and should be omitted.
communicationcommunicationVerificationClient 用于与 VerificationService 通信的 Communication 对象。该属性便于测试;若未显式指定,则会构造并使用正确的 Communication。ENCommunication object that the VerificationClient will use to talk to the VerificationService. This parameter is useful for testing. If left unspecified, the correct Communication will be constructed and used.译稿校对中
addEventListeneraddEventListener(eventType, functionToExecute)void订阅广告生命周期事件与度量(metric)事件。事件处理器会以单个参数被调用,该参数含以下字段:'adSessionId'(string)、'timestamp'(number)、'type'(string)、'data'(object)。ENSubscribes to ad lifecycle and metric events. The event handler will be called with a single argument that has the following fields: 'adSessionId': string, 'timestamp': number, 'type': string, 'data': object译稿校对中
  • eventType: AdEventTypeThe event type to subscribe this listener to.
  • functionToExecute: EventCallbackAn event handler to be invoked when the given event type is triggered.
attestattest(requestPayload, callback)void请求调用设备证明(attestation)机制。验证脚本可用本方法调用该设备所支持的证明机制。ENRequests the attestation mechanism to be invoked. This can be used by the verification scripts to invoke the attestation mechanism supported by this device.译稿校对中
  • requestPayload: AttestRequestPayloadcontains attestation details like mechanism name, version and mechanism specific payload
  • callback: AttestCallbackcallback to be executed.
clearIntervalclearInterval(intervalId)void取消重复回调的后续执行。ENCancels further execution of a repeated callback.译稿校对中
  • intervalId: numberThe ID returned from setInterval of the callback to cancel.
clearTimeoutclearTimeout(timeoutId)void在超时回调执行前取消该超时。行为等价于 window.clearTimeout 这一 Web API 方法。ENCancels a timeout before its callback has been executed. Provides behavior equivalent to the window.clearTimeout web API method.译稿校对中
  • timeoutId: numberThe ID returned from setTimeout of the callback to cancel.
getEnvironmentgetEnvironment()Environment|null获取 OM 服务的环境类型——即注入了验证资源的那个 OM 服务,或存在于全局上下文(如 window)中的那个 OM 服务。注意该判断依据所使用的服务二进制文件:omsdk-v1.js(App)或 omweb-v1.js(Web)。该二进制文件通常与 OM SDK 实际运行的环境一致,但也可能存在反例,例如 Web 服务二进制文件运行在移动应用内的 webview 中。ENGets the environment type of the OM Service that either injected the verification resource or is present in the global context (e.g. window). Note that this check is based on which service binary is used: omsdk-v1.js (App) or omweb-v1.js (Web). The binary typically corresponds to the actual environment in which the OM SDK is run, but there may be counterexamples such as the Web service binary running in a webview inside a mobile app.译稿校对中
injectJavaScriptResourceinjectJavaScriptResource(url, successCallback, failureCallback)void将所提供的 JavaScript 资源注入到与验证提供方相同的执行环境中。对所有基于 DOM 的环境(包括 Android 原生广告会话),本方法会向 DOM 追加 script 元素;对原生广告会话,本方法会将该职责委托给 OM SDK 库,由该库负责下载 JavaScript 内容并将其注入执行环境。ENInjects the supplied JavaScript resource into the same execution environment as the verification provider. For all DOM based environments (incl. Android native ad sessions) this will append `script` elements to the DOM. For native ad sessions this will delegate responsibility to the OM SDK library which will be responsible for downloading and injecting the JavaScript content into the execution environment.译稿校对中
  • url: stringThe URL of the JavaScript resource to load into the environment.
  • successCallback: function()Optional callback to be executed if the HTTP request was successful. Does not indicate whether the script evaluation was successful.
  • failureCallback: function()Optional callback to be executed if the script failed to load.
injectionSource已废弃injectionSource()Environment|undefined已弃用(DEPRECATED):改用 getEnvironment,它同时覆盖注入脚本与内联脚本。获取注入了该验证资源的 OM 服务的环境类型。ENDEPRECATED: use getEnvironment to cover both injected and inline scripts. Gets the environment type of the OM Service that injected the verification resource.译稿校对中
isSupportedisSupported()boolean检查 OMID 是否可用。ENChecks if OMID is available.译稿校对中
registerSessionObserverregisterSessionObserver(functionToExecute, vendorKey)void订阅所有会话事件('sessionStart'、'sessionError'、'sessionFinish')。本方法同时表明验证脚本已加载完毕并可接收事件,因此应在初始化时调用。事件处理器会以单个参数被调用,该参数含以下字段:'adSessionId'(string)、'timestamp'(number)、'type'(string)、'data'(object)。ENSubscribes to all session events ('sessionStart', 'sessionError', and 'sessionFinish'). This method also signals that the verification script has loaded and is ready to receive events, so it should be called upon initialization. The event handler will be called with a single argument that has the following fields: 'adSessionId': string, 'timestamp': number, 'type': string, 'data': object译稿校对中
  • functionToExecute: SessionObserverCallbackAn event handler which will be invoked on session events.
  • vendorKey: string
sendUrlsendUrl(url, successCallback, failureCallback)void请求目标 URL。可用于向远端服务器传输数据:将载荷(payload)作为查询参数嵌入 URL 后发起请求。ENRequests the target URL. This can be used to transmit data to a remote server by requesting a URL with the payload embeded into the URL as query arg(s).译稿校对中
  • url: stringThe URL to be requested.
  • successCallback: function()Optional callback to be executed if the request was successfully received (2xx response code).
  • failureCallback: function()Optional callback to be executed if the request was not successfully received (non-success response code or other error).
setIntervalsetInterval(functionToExecute, timeInMillis)number安排一个函数按指定间隔重复调用。行为等价于 window.setInterval 这一 Web API 方法。ENSchedules a function to be called repeatedly at a specified interval. Provides behavior equivalent to the window.setInterval web API method.译稿校对中
  • functionToExecute: function()The callback to execute repeatedly.
  • timeInMillis: numberThe number of milliseconds to wait between callback invocations.
setTimeoutsetTimeout(functionToExecute, timeInMillis)number安排一个函数在指定延迟之后被调用。行为等价于 window.setTimeout 这一 Web API 方法。ENSchedules a function to be called a function after the specified delay. Provides behavior equivalent to the window.setTimeout web API method.译稿校对中
  • functionToExecute: function()The callback to execute after the delay.
  • timeInMillis: numberThe number of milliseconds to wait before invoking the callback.
docs.iabtechlab.com/omsdk-1.6/js/VerificationClient.html

VerificationScriptResourcejs · 6

表示一个验证脚本资源(verification script resource):在 VAST 3 及以下版本中来自 VAST 扩展(extension),在 VAST 4 及以上版本中来自 verification 节点。ENRepresents a verification script resource that comes in a VAST extension for VAST versions <= 3 or a verification node for VAST versions >= 4译稿校对中

名称签名返回官方描述
VerificationScriptResourcenew VerificationScriptResource(resourceUrl, vendorKey, verificationParameters, accessMode)void创建新的验证脚本资源实例,需提供特定于厂商的验证参数。ENCreates new verification script resource instance which requires vendor specific verification parameters.译稿校对中
  • resourceUrl: string
  • vendorKey: string
  • verificationParameters: string
  • accessMode: AccessModeThe level of access this verification script will have when executed.
accessModeaccessMode: AccessModeAccessMode(官方未提供描述)
resourceUrlresourceUrl: stringstring(官方未提供描述)
vendorKeyvendorKey: string(string|undefined)(官方未提供描述)
verificationParametersverificationParameters: string(string|undefined)(官方未提供描述)
toJSONtoJSON()Object(官方未提供描述)
docs.iabtechlab.com/omsdk-1.6/js/VerificationScriptResource.html

跨平台命名对照

概念JavaScriptiOSAndroid
ad-eventsAdEventsOMIDAdEventsAdEvents
ad-sessionAdSessionOMIDAdSessionAdSession
ad-session-configurationOMIDAdSessionConfigurationAdSessionConfiguration
ad-session-contextOMIDAdSessionContextAdSessionContext
contextContext
js-session-serviceOMIDJavaScriptSessionService
media-eventsMediaEventsOMIDMediaEventsMediaEvents
omid-versionOmidVersion
partnerPartnerOMIDPartnerPartner
script-injectorOMIDScriptInjectorScriptInjector
sdk-entryOMIDSDKOmid
universal-ad-idOMIDUniversalAdID
vast-propertiesOMIDVASTPropertiesVastProperties
verification-clientVerificationClient
verification-script-resourceVerificationScriptResourceOMIDVerificationScriptResourceVerificationScriptResource
  • ad-session-configurationJS 无对应类:creativeType/impressionType 由 AdSession.setCreativeType()/setImpressionType() 设置,事件 owner(impressionOwner/mediaEventsOwner)概念在 JS 侧不存在。
  • ad-session-context对应 JS 的 Context:JS 把 partner、verificationScriptResources、contentUrl、customReferenceData、universalAdId 与 slot/video element 折叠进 Context 及 AdSession 构造参数,原生侧则拆为 AdSessionContext(iOS 另有 AdSessionConfiguration)。
  • contextiOS/Android 无同名类:JS 的 Context 在原生侧被拆分为 AdSessionContext + AdSessionConfiguration(见 ad-session-context / ad-session-configuration 两条)。
  • js-session-service仅 iOS 公开:OM SDK iOS 内置的 JS 会话服务(Android 由 Omid/OmidJsBridge 承担,未在 javadoc 站点公开对应类)。
  • omid-version仅 JS 公开:源码 omid-version.js 顶部有 TODO(OMSDK-715) 注明该类似未使用、下个大版本应移除,但 JSDoc 站点仍发布。
  • script-injectoriOS OMIDScriptInjector / Android ScriptInjector:把验证脚本内容注入 HTML 创意;JS 侧由 OM SDK service 完成,无公开类。
  • sdk-entryiOS 为 OMIDSDK(+sharedInstance / -activate),Android 为 Omid(activate(Context) / isActive());JS 侧无对应类,服务脚本由 OM SDK service 自行装载。
  • universal-ad-id仅 iOS 公开:JS 源码有 UniversalAdId(packageExport 到 OmidSessionClient.UniversalAdId,1.5.5 新增)但官方 JSDoc 站点无对应页面;Android 的 createNativeAdSessionContext(...)/getUniversalAdId() 在签名中引用 UniversalAdId 类型,javadoc 站点亦无该页(实测 404)。
  • vast-propertiesJS 侧 VastProperties(src/common/vast-properties.js,标 @public 且在 jsdoc.json 的 include 列表内)未被官方 JSDoc 站点发布(VastProperties.html 实测 404),故 js 记 null;AdEvents.loaded(vastProperties) 因此引用了一个站点上没有文档的类型。
  • verification-client仅 JS 公开:验证脚本(第三方测量)一律使用 JS 的 OmidVerificationClient,原生 SDK 不含验证客户端。

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

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