ORTB
…
SIMID 分册导航

SIMID 1.0.0

历史版本

规范自标版本 1.0.0 · 发布口径 2019-06-27 · 源文件 simid-1.0.html

取官方 Bikeshed 渲染稿 subtitle 的 Living Standard 日期(datetime 属性)

本页正文为该版官方原文照录;参数结构取自正文里的 WebIDL 代码块。

本页目录

消息总表

官方 §4.1 的 API / resolve / reject 对照表;站内另有按消息展开的参数树,可点行内消息名跳转。

All SIMID messages are sent via the § 8 Messaging Protocol

APIresolvereject
SIMID:Media:durationchangen/an/a
SIMID:Media:endedn/an/a
SIMID:Media:errorn/an/a
SIMID:Media:pausen/an/a
SIMID:Media:playn/an/a
SIMID:Media:playingn/an/a
SIMID:Media:seekedn/an/a
SIMID:Media:seekingn/an/a
SIMID:Media:stalledn/an/a
SIMID:Media:timeupdaten/an/a
SIMID:Media:volumechangen/an/a
SIMID:Player:adSkipped§ 4.3.1.1 resolven/a
SIMID:Player:adStopped§ 4.3.2.1 resolven/a
SIMID:Player:appBackgrounding§ 4.3.3.1 resolven/a
SIMID:Player:appForegroundingn/an/a
SIMID:Player:fatalError§ 4.3.5.1 resolven/a
SIMID:Player:init§ 4.3.6.1 resolve§ 4.3.6.2 reject
SIMID:Player:logn/an/a
SIMID:Player:resizen/an/a
SIMID:Player:startCreative§ 4.3.9.1 resolve§ 4.3.9.2 reject
SIMID:Creative:clickThrun/an/a
SIMID:Creative:fatalErrorn/an/a
SIMID:Creative:getVideoState§ 4.4.3.1 resolven/a
SIMID:Creative:logn/an/a
SIMID:Creative:reportTracking§ 4.4.5.1 resolve§ 4.4.5.2 reject
SIMID:Creative:requestChangeAdDuration§ 4.4.6.1 resolve§ 4.4.6.2 reject
SIMID:Creative:requestChangeVolume§ 4.4.7.1 resolve§ 4.4.7.2 reject
SIMID:Creative:requestFullScreen§ 4.4.8.1 resolve§ 4.4.8.2 reject
SIMID:Creative:requestExitFullScreen§ 4.4.9.1 resolve§ 4.4.9.2 reject
SIMID:Creative:requestPause§ 4.4.10.1 resolve§ 4.4.10.2 reject
SIMID:Creative:requestPlay§ 4.4.11.1 resolve§ 4.4.11.2 reject
SIMID:Creative:requestResize§ 4.4.12.1 resolve§ 4.4.12.2 reject
SIMID:Creative:requestSkip§ 4.4.13.1 resolve§ 4.4.13.2 reject
SIMID:Creative:requestStop§ 4.4.14.1 resolve§ 4.4.14.2 reject

SIMID:Media · 媒体事件

When the media element that renders ad media dispatches events, the player posts corresponding messages to the SIMID creative. Media element related messages include original media event type names. Message.type values are prepended with SIMID:Media namespace.

Example:

  1. Media element dispatches event play.
  2. Player sends message to SIMID creative with Message.type = SIMID:Media:play.

Video messages should be reported immediately after player receives related event.

Message.timestamp property value is set to the time media element dispatches event.

SIMID:Media:durationchange

§4.2.1无需应答

parameters:

  1. duration(float): The number in seconds of the video duration. For server side ad insertion this must be calculated to be the total duration of the ad.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
durationfloatThe number in seconds of the video duration. For server side ad insertion this must be calculated to be the total duration of the ad.

SIMID:Media:ended

§4.2.2无需应答

官方未给该消息定义 args 参数。

SIMID:Media:error

§4.2.3无需应答

parameters:

  1. error(DOMString): corresponds to videoElement.error.code.
  2. message(DOMString): corresponds to videoElement.error.message.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
errorDOMStringcorresponds to videoElement.error.code.
messageDOMStringcorresponds to videoElement.error.message.

SIMID:Media:pause

§4.2.4无需应答

官方未给该消息定义 args 参数。

SIMID:Media:play

§4.2.5无需应答

官方未给该消息定义 args 参数。

SIMID:Media:playing

§4.2.6无需应答

官方未给该消息定义 args 参数。

SIMID:Media:seeked

§4.2.7无需应答

官方未给该消息定义 args 参数。

SIMID:Media:seeking

§4.2.8无需应答

官方未给该消息定义 args 参数。

SIMID:Media:stalled

§4.2.9无需应答

官方未给该消息定义 args 参数。

SIMID:Media:timeupdate

§4.2.10无需应答

parameters:

  1. currentTime(number): corresponds to videoElement.currentTime attribute. For server side ad insertion this must be calculated to be the total time the video ad has played. For example: if the media element time is 500 seconds but the ad started playback 10 seconds ago (in DAI), currentTime should be set to 10 seconds.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
currentTimenumbercorresponds to videoElement.currentTime attribute. For server side ad insertion this must be calculated to be the total time the video ad has played. For example: if the media element time is 500 seconds but the ad started playback 10 seconds ago (in DAI), currentTime should be set to 10 seconds.

SIMID:Media:volumechange

§4.2.11无需应答

parameters:

  1. volume(number): corresponds to videoElement.volume attribute.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
volumenumbercorresponds to videoElement.volume attribute.

SIMID:Player · 播放器发给创意

For example:

{
type: "SIMID:Player:adStopped",
args: {
code: 0
}
}

SIMID:Player:adSkipped

§4.3.1resolve

官方未给该消息定义 args 参数。

响应 · resolve §4.3.1.1

SIMID:Player:adStopped

§4.3.2resolve

The player should wait for the resolve response before unloading the creative iframe. The player should implement a reasonable timeout to allow for creative to conclude ad end logic.

parameters:

  1. code(int): reason for ad stopping

The player should use the following table to determine which code to send.

  1. 0: Unspecified
  2. 1: User initiated close
  3. 2: Ad media playback complete
  4. 3: Player initiating close before media playback complete
  5. 4: Creative initiated close

In response to SIMID:Player:adStopped, creative finalizes the ad end logic and responds with resolve message.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
codeintreason for ad stopping

响应 · resolve §4.3.2.1

SIMID:Player:appBackgrounding

§4.3.3resolve

官方未给该消息定义 args 参数。

响应 · resolve §4.3.3.1

SIMID:Player:appForegrounding

§4.3.4无需应答

官方未给该消息定义 args 参数。

SIMID:Player:fatalError

§4.3.5resolve
  1. errorCode(int): reason for error. See § 8.4 Error Codes
  2. errorMessage(DOMString): Any additional information.

官方未给该消息定义 args 参数。

响应 · resolve §4.3.5.1

SIMID:Player:init

§4.3.6resolvereject

To assist in preloading assets the player must send the SIMID:Player:init message before SIMID:Player:startCreative. The player should send this message early enough before playback so that assets can be displayed as soon as the ad starts.

The ad, however, should not assume it is given any amount of time between the SIMID:Player:init message and the SIMID:Player:startCreative message. For example a preroll might send SIMID:Player:startCreative immediately after SIMID:Player:init.

With SIMID:Player:init, the player shall provide the following parameters:

dictionary InitParameters {
required EnvironmentData environmentData;
required CreativeData creativeData;
};
dictionary CreativeData {
required DOMString adParameters;
DOMString clickThruUrl;
};
dictionary EnvironmentData {
required VideoDimensions videoDimensions;
required CreativeDimensions creativeDimensions;
required boolean fullScreen;
required boolean fullscreenAllowed;
required boolean variableDurationAllowed;
required SkippableState skippableState;
required DOMString version;
DOMString siteUrl;
DOMString appId;
DOMString useragent;
DOMString deviceId;
boolean muted;
float volume;
};

enum SkippableState {"playerHandles", "adHandles", "notSkippable"};
  1. CreativeData is used to pass information associated with the creative (sometimes taken from VAST). In a VAST context, the ad unit should pass the value for either the Linear or Nonlinear AdParameter element specified in the VAST document.
  2. EnvironmentData is used to pass information associated with the publisher playback environment. The object should have the following fields.

参数结构WebIDL dictionary · InitParameters

参数类型必选取值
environmentDataEnvironmentData✓
videoDimensionsVideoDimensions✓
xlong✓
ylong✓
widthlong✓
heightlong✓
creativeDimensionsCreativeDimensions✓
xlong✓
ylong✓
widthlong✓
heightlong✓
fullScreenboolean✓
fullscreenAllowedboolean✓
variableDurationAllowedboolean✓
skippableStateSkippableState✓playerHandles / adHandles / notSkippable
versionDOMString✓
siteUrlDOMString
appIdDOMString
useragentDOMString
deviceIdDOMString
mutedboolean
volumefloat
creativeDataCreativeData✓
adParametersDOMString✓
clickThruUrlDOMString

响应 · resolve §4.3.6.1

响应 · reject §4.3.6.2

  1. reason(DOMString): An optional string error message
  2. errorCode(int): The code for what went wrong in initialization. See § 8.4 Error Codes

SIMID:Player:log

§4.3.7无需应答

Note: If the creative is doing something out of spec and the player will not exit with a fatal error, the player’s log message should start with "WARNING:". Creative developers should monitor for this message.

parameters:

  1. message(DOMString): Logging information from the player to the creative.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
messageDOMStringLogging information from the player to the creative.

SIMID:Player:resize

§4.3.8无需应答

parameters:

dictionary ResizeParameters {
required VideoDimensions videoDimensions;
required CreativeDimensions creativeDimensions;
required boolean fullScreen;
};
dictionary VideoDimensions {
required long x;
required long y;
required long width;
required long height;
};
dictionary CreativeDimensions {
required long x;
required long y;
required long width;
required long height;
};

The VideoDimensions communicate to the creative the dimensions of the video element. The CreativeDimensions tell the creative where the iframe is located as well as its dimensions. If the iframe is not yet visible (like during initialization) these dimensions will be the expected dimensions when it does become visible.

  1. VideoDimensions
  2. CreativeDimensions
  3. ResizeParameters

参数结构WebIDL dictionary · ResizeParameters

参数类型必选取值
videoDimensionsVideoDimensions✓
xlong✓
ylong✓
widthlong✓
heightlong✓
creativeDimensionsCreativeDimensions✓
xlong✓
ylong✓
widthlong✓
heightlong✓
fullScreenboolean✓

SIMID:Player:startCreative

§4.3.9resolvereject

SIMID:Player:startCreative must be sent when the player is ready to make the iframe visible.

官方未给该消息定义 args 参数。

响应 · resolve §4.3.9.1

响应 · reject §4.3.9.2

  1. reason(DOMString): An optional string error message
  2. errorCode(int): The code for what went wrong in initialization. See § 8.4 Error Codes

SIMID:Creative · 创意发给播放器

SIMID:Creative:clickThru

§4.4.1无需应答

The creative must handle click-thru due to the nature of cross-origin iframes. This message must only be sent in response to a user-initiated click that is considered a click-thru by the creative.

The main purpose of this message is for the player to track click-thrus. Since not every navigation is a click-thru, it should not be used for adjusting media playback status (pause, mute). If the player wants to update media playback status as a result of navigation, it should detect it via some other environment-specific method (eg. Page Visibility API on web and in apps).

Parameters:

  1. x (int): the x coordinate of the click relative to the left of the creative.
  2. y (int): the y coordinate of the click relative to the top of the creative.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
xintthe x coordinate of the click relative to the left of the creative.
yintthe y coordinate of the click relative to the top of the creative.

SIMID:Creative:fatalError

§4.4.2无需应答

parameters:

  1. errorCode(int): reason for error. See § 8.4 Error Codes
  2. errorMessage(DOMString): Any optional additional information about the fatal error.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
errorCodeintreason for error. See § 8.4 Error Codes
errorMessageDOMStringAny optional additional information about the fatal error.

SIMID:Creative:getVideoState

§4.4.3resolve

官方未给该消息定义 args 参数。

响应 · resolve §4.4.3.1

  1. currentSrc(DOMString): The src of which ad has been chosen. This may need correction for server side ad insertion as it should indicate the video media selected and not the url to the media playing.
  2. currentTime(number): This should be the current time from the first frame of the video ad. In the case of DAI, this number needs to be corrected. For example: if the video element time is 500 seconds but the ad started playback 10 seconds ago (in DAI), this should be 10 seconds.
  3. duration(number): This should be the duration of the ad. Server side ad insertion may need correction.
  4. ended(boolean): corresponds exactly to video element ended attribute
  5. muted(boolean): corresponds exactly to video element muted attribute
  6. paused(boolean): corresponds exactly to video element paused attribute
  7. volume(number): corresponds exactly to video element volume attribute
  8. fullscreen(boolean): true if the video element is full screen, false otherwise

SIMID:Creative:log

§4.4.4无需应答

Note: If the player is doing something out of spec and the creative will not exit with a fatal error, the creatives log message should start with "WARNING:". Player developers should monitor for this message.

parameters:

  1. message(DOMString): Logging information sent from the creative to the player.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
messageDOMStringLogging information sent from the creative to the player.

SIMID:Creative:reportTracking

§4.4.5resolvereject
  1. trackingUrls(Array ): An array of tracking pixels that the publisher should fire.

The creative is not required to use SIMID:Creative:reportTracking. However, the player must implement SIMID:Creative:reportTracking.

All tracking urls sent through SIMID:Creative:reportTracking must have their macros replaced as though they were tracking pixels specified in VAST. Then they must be reported by the player as though they were tracking pixels.

官方未给该消息定义 args 参数。

响应 · resolve §4.4.5.1

响应 · reject §4.4.5.2

parameters:

  1. reason(DOMString): An optional string error message
  2. errorCode(int): The code for why the player did not attempt to send a tracking pixel. See § 8.4 Error Codes
参数类型必选取值
reasonDOMStringAn optional string error message
errorCodeintThe code for why the player did not attempt to send a tracking pixel. See § 8.4 Error Codes

SIMID:Creative:requestChangeAdDuration

§4.4.6resolvereject

paramaters:

  1. duration(int): The new duration of the creative. -2 indicates unknown ad duration.

参数结构散文参数列表(1.0 写法)

参数类型必选取值
durationintThe new duration of the creative. -2 indicates unknown ad duration.

响应 · resolve §4.4.6.1

响应 · reject §4.4.6.2

SIMID:Creative:requestChangeVolume

§4.4.7resolvereject
  1. volume(float): a number between 0 and 1 indicating what volume the creative wants.
  2. muted(boolean): True indicates the creative wants the volume muted.

官方未给该消息定义 args 参数。

响应 · resolve §4.4.7.1

响应 · reject §4.4.7.2

SIMID:Creative:requestFullScreen

§4.4.8resolvereject

官方未给该消息定义 args 参数。

响应 · resolve §4.4.8.1

响应 · reject §4.4.8.2

SIMID:Creative:requestExitFullScreen

§4.4.9resolvereject

官方未给该消息定义 args 参数。

响应 · resolve §4.4.9.1

响应 · reject §4.4.9.2

SIMID:Creative:requestPause

§4.4.10resolvereject

官方未给该消息定义 args 参数。

响应 · resolve §4.4.10.1

响应 · reject §4.4.10.2

SIMID:Creative:requestPlay

§4.4.11resolvereject

官方未给该消息定义 args 参数。

响应 · resolve §4.4.11.1

响应 · reject §4.4.11.2

SIMID:Creative:requestResize

§4.4.12resolvereject

Request resize should use the ResizeParameters which are explained in § 4.3.8 SIMID:Player:resize

官方未给该消息定义 args 参数。

响应 · resolve §4.4.12.1

响应 · reject §4.4.12.2

SIMID:Creative:requestSkip

§4.4.13resolvereject

If the player cannot stop video playback, the player must not unload the iframe in response to this request.

官方未给该消息定义 args 参数。

响应 · resolve §4.4.13.1

响应 · reject §4.4.13.2

SIMID:Creative:requestStop

§4.4.14resolvereject

If the player cannot stop video playback, the player still unloads the iframe. The creative may hide all elements in this case if it doesn’t wish to be seen.

官方未给该消息定义 args 参数。

响应 · resolve §4.4.14.1

响应 · reject §4.4.14.2

消息协议(数据 / 传输 / 会话)

Messages sent using the standard postMessage API are processed asychronously. To facilitate asynchronous communication between the media player and the creative, SIMID employs a custom messaging protocol.

The protocol defines both the data structure of messages exchanged by both parties and the algorithms needed to reliably handle the exchange of these messages.

The protocol is designed to be easily implemented on top of the postMessage interface, available across the cross-domain iframe elements which are used to isolate the SIMID creative from the media player.

Message 结构

成员类型必选
sessionIdDOMString✓
messageIdunsigned long✓
timestampunsigned long✓
typeDOMString✓
argsany

数据层

8.3Message Data Structure

A protocol message is represented by the Message data structure.

dictionary Message {
required DOMString sessionId;
required unsigned long messageId;
required unsigned long timestamp;
required DOMString type;
any args;
};

A Message has an associated sessionId, a string that uniquely identifies the session to which the Message belongs.

A Message has an associated messageId, an integer that increments with each message sent by the sender over the session specified by sessionId.

Note: The combination of sessionId and messageId uniquely identifies a single message. The combination of the values of these two attributes may never occur twice.

A Message has timestamp property. timestamp is expressed in a number of milliseconds since January 1, 1970, 00:00:00 UTC (Epoch time). Message sender must set timestamp value as close as possible to the moment the underlying process occurs. However, the receiver should not assume that timestamp value reflects the exact instant Message triggering event chain was accomplished.

For example, if Message communicates ad video state change, media player sets timestamp value to the moment the corresponding video event arrives from HTMLVideoElement.

A Message has an associated type, a string that defines the type of message that is being sent and informs the receiver how to interpret the args parameter.

A Message may have associated args, which are type-specific additional arguments. The data structure and meaning of args is defined in the respective message type definitions.

消息类别

8.3.1resolve messages

type must be resolve

args must be a ResolveMessageArgs object:

dictionary ResolveMessageArgs {
required unsigned long messageId;
any value;
};

messageId refers to the messageId attribute of the message that is being resolved.

value may include a value associated with this resolve message.

8.3.2reject messages

type must be reject

args must be a ResolveMessageArgs object.

value may include an error message associated with this reject message.

dictionary ResolveMessageArgsValue {
unsigned long errorCode;
DOMString message;
};

传输层

8.1Transport Layer

A transport is a communication mechanism that can send serialized messages between two parties. In SIMID’s case, those are the video player and the creative.

A serialized message is a text string that one of the parties, the sender, forwards to the other party, the receiver, through the transport.

The transport must guarantee the following properties:

  1. It must guarantee that both parties of the channel are unambiguously defined and that only those two parties observe any serialized messages sent by either of them.
  2. It must guarantee that all serialized messages eventually get delivered to the other party.
  3. It must guarantee that the serialized messages are delivered intact, without any modifications.
  4. It must guarantee that all serialized messages are delivered in the order that they were sent by the sender.

The transport is not required to deliver serialized messages synchronously, but it must deliver them as soon as possible.

Note: This means that a sender can not assume that a message is delivered to the receiver unless the receiver sends a message back that acknowledges receipt. It also means that exceptions on the receiver’s side can’t be caught by the sender unless the receiver explicitly sends a message back to the sender with the exception.

8.1.1postMessage Transport

In SIMID the media player and creative use the standard postMessage API to communicate across the cross-origin iframe boundary.

8.1.2Message Serialization

To serialize a Message to a serialized message, apply JSON.stringify to the Message data structure. The resulting DOMString represents the serialized message.

To deserialize a serialized message to a Message data structure, apply JSON.parse to the serialized message. The resulting object has the Message data structure.

The sender should not transmit any serialized messages that cannot be correctly deserialized by the receiver.

The receiver should discard and ignore any serialized messages that it cannot correctly deserialize.

会话层

8.2Session Layer

Multiple sessions may be active over a single transport at any given time.

A session is uniquely identified by a session identifier. All messages belonging to a session must reference the same session identifier.

8.2.1Establishing a new session

A session is established by running the establish a new session algorithm.

To establish a new session, you must run the following steps:

Input
none
Output
sessionIdPromise, a Promise that will resolve to a session identifier
  1. Let sessionId be a new session identifier.

It is recommended to use a UUID for the session identifier.

  1. Let type be createSession.
  2. Let args be undefined.
  3. Let sessionIdPromise be a new unresolved Promise.
  4. Start the send an acknowledgement message algorithm with sessionId, type and args. Let ackPromise be the return value.
  5. Return sessionIdPromise.
  6. When ackPromise resolves:

8.2.2Sending messages

To send a message through a session, run the send a message algorithm.

To send a message, you must run the following steps synchronously:

Input
sessionId, a session identifier
Output
messageId, a message identifier
  1. Let messageId be
  2. Let timestamp be the current number of milliseconds since January 1, 1970, 00:00:00 UTC (Epoch time).
  3. Let message be a new Message object with its attributes initialized to sessionId, messageId, type, timestamp and args.
  4. Let serializedMessage be the result of running JSON.stringify on message.
  5. Transmit serializedMessage to the other party through the transport.
  6. Return messageId.

While most messages can be sent "fire-and-forget", some require the sender to be informed that they were properly received and handled by the receiver. The protocol uses semantics similar to the Promise API for this.

To send an acknowledgement message, you must run the following steps:

Input
sessionId, a session identifier
Output
promise, a Promise which will eventually resolve to the value sent back by the other party
  1. Run the send a message algorithm with sessionId, type and args. Let messageId be the return value.
  2. Let promise be a new unresolved Promise.
  3. Add promise to the resolve list, annotated with sessionId and messageId.
  4. Return promise.

8.2.3Receiving messages

To be able to detect new incoming sessions and receive messages from existing sessions, every party should start running the handle incoming messages algorithm as soon as possible.

To handle an incoming message, you must run the following steps:

Input
serializedMessage, a serialized message received from the transport
Output
none
  1. Let message be the result of running JSON.parse on serializedMessage.
  2. If JSON.parse threw an exception, ignore the exception and abort execution of this algorithm.
  3. If message.type is resolve or reject:
  4. Let sessionId be message.sessionId.
  5. Let messageId be message.args.messageId.
  6. Let promise be the promise in the resolve list for sessionId and messageId, if any.
  7. If a promise was found:
  8. Otherwise: pass message to the user of the protocol for handling.

枚举类型

枚举取值
SkippableStateplayerHandles / adHandles / notSkippable

错误码

If the media cannot be played the player should terminate the ad and fire an error using the standard VAST errors.

If either the interactive ad or player wants to terminate with an error the player should fire a 902 error. In cases where this is not possible like live server side ad insertion the player should remove the ad overlay and continue tracking quartiles and completion.

The ad or player should pass a specific error code to indicate why it errored out. The ad can also hand back a string with extra details about the error.

创意侧(1100-1199): 12播放器侧(1200-1299): 0
错误码类型说明
1100Unspecified error.Catchall error if the creative could not find a matching error code. The creative should be more specific in the error message.
1101Resources could not be loaded.The SIMID creative tried to load resources but failed.
1102Playback area not usable by creative.The dimensions the creative needed were not what it received.
1103Wrong SIMID version.The creative could not support the players version.
1104Creative not playable for a technical reason on this site.
1105Request for expand not honored.The creative requested to expand but the player did not allow it.
1106Request for pause not honored.The creative requested pause but the player did not pause.
1107Play mode not adequate for creative.The creative requires playback control but the player is not giving control. This error should only fire if the VAST for the ad specified that it needs playback control.
1108Ad internal error.The creative had an error not related to any external dependencies.
1109Device not supported.The creative could not play or render on the device.
1110The player is not following the spec in the way it sends messages.
1111The player is not responding adequately to messages.

术语

SIMID VAST
The VAST document that contains the SIMID ad unit components.
SIMID Ad Unit
The SIMID ad video and the SIMID ad creative.
SIMID Video
The SIMID ad video component if it’s a progressively downloaded video file.
SIMID Video Stream
The SIMID ad video component if it’s SSAI video.
SIMID Live Video Stream
The SIMID ad video component if live streaming video.
SIMID Creative
The SIMID ad creative component (html doc and assets) that overlays the SIMID ad video.
SIMID Secondary Video
Video assets that are loaded as part of the SIMID creative and not the primary video.
Content Video
Any reference to video that is NOT a component or asset of the ad unit.

VAST 承载点

When a SIMID creative is referenced within a VAST document, the <InteractiveCreativeFile> element must include the following required attributes on the element: type="text/html" and apiFramework="SIMID".

The value of the apiFramework attribute identifies SIMID as the required API for the creative. Players that do not support the SIMID API may load an audio or video file included with the ad, but they will not load or play the SIMID creative.

Media players that do support the SIMID API should handle version negotiation between the creative and the media player via the § 6.1 How to Handle Ad Loading algorithm. The SIMID API version is not identified by any element or attribute in the VAST file.

A third, optional attribute which may be included on the InteractiveCreativeFile element is variableDuration="true". If present, this attribute indicates that the ad unit is only playable if the media player allows the creative to pause playback of the ad’s audio or video and extend the duration of the ad break (for example, with interactive content such as a game or survey). If the player does not support or allow this capability, then it must not render the current ad’s audio/video or SIMID creative. The player should error out the ad instead (and either resume its primary content or continue on to the next ad in the current ad pod).

VAST · AdCOM apiFramework

常用工作流

6.1How to Handle Ad Loading

The player must follow this workflow for loading an ad.

  1. The player must create an iframe element for the SIMID creative. The player iframe should start out hidden. The iframe should be capable of executing javascript and loading resources.
  2. The player starts listening on the window that is the parent of the iframe for messages from the creative.
  3. The player sets the src element of the iframe to the url provided by the creative’s VAST InteractiveCreativeFile element. The player should assume this will be a cross domain iframe.
  4. The player waits until the creative inializes a session. § 8.2.1 Establishing a new session The player responds with a resolve message. The resolve message includes the correlator that must be present in all messages going forward.
  5. The player then sends a § 4.3.6 SIMID:Player:init message with all relevant parameters. The player waits until the creative responds with resolve. If the creative responds with reject, the player should immediately unload the creative’s iframe.
  6. Where possible the player should wait until both the creative has responded to the § 4.3.6 SIMID:Player:init and the video is ready to start playing. Ready to start playing means the first frame will show and playback will continue.
  7. When the video is started the player sends a § 4.3.9 SIMID:Player:startCreative message. The player must overlay the creative iframe over the video element exactly. The player must make the creative visible. The creative should respond to this message immediately with § 4.3.9.1 resolve.
6.2How to Handle Ad Playback

The video player is responsible for handling playback of the video as well as tracking video related events. The SIMID creative on the other hand handles playback of interactive content and internal tracking related to interactivity (custom events, creative impression if desired (recommended)).

6.2.1Ad Pause

If the variableDurationAllowed flag is set to true then the player should enable video pause by the SIMID creative via the SIMID:Creative:requestPause message. The player must respond to SIMID:Creative:requestPause with the AdPaused event.

When the SIMID creative would like to resume video playback, it should send a SIMID:Creative:requestPlay message. The player must respond to SIMID:Creative:requestPlay message with resolve and play the video.

6.2.2Ad Resizing and Fullscreen

The player may resize the ad slot. The player must send a § 4.3.8 SIMID:Player:resize message any time the ad slot size is changed.

If fullscreenAllowed is true, the SIMID creative may send a § 4.4.8 SIMID:Creative:requestFullScreen message. The player must resize only the ad slot to fullscreen (not the video). The SIMID creative then will resize the video as it sees fit. The player must send a § 4.3.8 SIMID:Player:resize message to the SIMID creative with fullScreen set to true and videoDimensions and creativeDimensions set to the full screen dimensions.

If player goes fullscreen on its own. Then the player must send a § 4.3.8 SIMID:Player:resize message to the SIMID creative with fullScreen set to true and videoDimensions and creativeDimensions set to the full screen dimensions.

6.3How to Handle Ad End and Unload

Following are cases where ad can end:

  1. Ad was skipped, either by player or creative (if the ad contains the skip button). See § 6.3.1 Ad Skips.
  2. The creative has fired § 4.4.14 SIMID:Creative:requestStop message and the player has allowed the ad to stop.
  3. The player has fired § 4.3.2 SIMID:Player:adStopped message and the creative resolved.
  4. Ad errors out. See § 6.3.5 Ad Errors Out.
6.3.1Ad Skips

Skip Ad Handled by Player

  1. The player sends a § 4.3.1 SIMID:Player:adSkipped message to the ad.
  2. The player hides the creative.
  3. The creative may dispatch any tracking pixels via § 4.4.5 SIMID:Creative:reportTracking
  4. The creative may wait for § 4.4.5.1 resolve from the reportTracking message.
  5. The creative dispatches resolve on the adSkipped message § 4.3.1.1 resolve.
  6. The player fires any skip tracking pixels.
  7. The player unloads the ad.

Skip Ad Handled by Ad

  1. The creative dispatches § 4.4.13 SIMID:Creative:requestSkip.
  2. The player dispatches resolves the to the requestSkip message.
  3. The player follows all the steps in Skip Ad Handled by Player.
6.3.2Ad Ends Before Video Completion

This scenario applies when the ad chooses to signal the player to kill it, typically at the prompting of the viewer. A good example would be a survey that allows the viewer to skip immediately to content when completed.

  1. The ad cleans up and dispatches § 4.4.14 SIMID:Creative:requestStop.
  2. The player unloads the ad.
6.3.3Ad Extends Beyond Video Completion

This scenario is only possible when the variableDurationAllowed flag is set to true. Video duration must only be extended in response to user interaction.

  1. User interacts at any point during playback of the video, triggering extended ad portion.
  2. The Creative dispatches § 4.4.6 SIMID:Creative:requestChangeAdDuration message with the new duration.
  3. The ad enters its extended phase.
  4. The creative dispatches § 4.4.14 SIMID:Creative:requestStop when extended phase is finished.
6.3.4Ad Completes at Video Completion

When an ad finishes at the same time as its video.

  1. The player sends a § 4.3.2 SIMID:Player:adStopped message to the ad.
  2. The player hides the creative.
  3. The creative may dispatch any tracking pixels via § 4.4.5 SIMID:Creative:reportTracking
  4. The creative may wait for a § 4.4.5.1 resolve response message from the reportTracking message.
  5. The creative dispatches resolve on the adSkipped message § 4.3.2.1 resolve.
  6. The player unloads the ad.
6.3.5Ad Errors Out

The SIMID creative or the player may terminate the ad unit with an error at any time. If the SIMID creative indicates an error, the player should try to stop ad unit playback. This might not be possible in server side stitched ads.

The player may error out if the ad does not respond with § 4.3.6.1 resolve in a reasonable amount of time.

When an player errors out it must follow these steps.

  1. The player sends a § 4.3.5 SIMID:Player:fatalError message to the ad.
  2. The player hides the creative.
  3. The creative may dispatch any tracking pixels via § 4.4.5 SIMID:Creative:reportTracking
  4. The creative may wait for a § 4.4.5.1 resolve response from the reportTracking message.
  5. The creative dispatches resolve on the adSkipped message § 4.3.5.1 resolve.
  6. The player unloads the ad.
6.3.6User Experience

This specification does not define the user experience for a close control or other generic media interaction behavior by the ad creative or the media player. The publisher media player is in full control over its user experience and can present its controls (or hide them) as needed. The publisher media player may dismiss the ad creative at any point in time. The ad creative can also request to be dismissed at any point in time. Some implementations may have a publisher provided close control, as well as various other controls, and others may not. An ad creative may opt to show its own controls, including a close control. Both ad creatives and media players should ensure that consumers are presented with a good ad experience.

6.3.7Additional Notes

The player may send a § 4.3.2 SIMID:Player:adStopped message at any time. The creative should respond with resolved after finishing its ad end logic. The player should allow 1 second between sending the § 4.3.2 SIMID:Player:adStopped message and receiving resolved. The implementer of the player should take into consideration that dropping a SIMID ad unit before it has dispatched resolved may result in tracking discrepancies, and that sending the § 4.3.2 SIMID:Player:adStopped message before the ad experience has ended (which is AFTER the optional lean-in phase) could harm the overall ad experience.

The SIMID creative may also dispatch § 4.4.14 SIMID:Creative:requestStop at any time, signaling to the player that the ad has finished and unloaded. Any further interaction with the SIMID creative after requestStop may not result in the desired outcome. The same is true for fatalError.

官方报文示例

示例照录官方代码块。它们多为键未加引号的 JS 对象字面量,可直接粘进报文解析器验证。

4.3Messages from the playerJS literal

{
type: "SIMID:Player:adStopped",
args: {
code: 0
}
}

在报文解析器中打开