Constructor
new Context(partnernon-null, verificationScriptResourcesnullable, contentUrlopt, nullable, customReferenceDataopt, nullable)
Create a new ad session context providing reference to partner and a list
of script resources which should be managed by OM SDK service.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
partner |
Partner | The integration's partner ID and version. | ||
verificationScriptResources |
Array.<!VerificationScriptResource> |
<nullable> |
The verification resources to load. | |
contentUrl |
string |
<optional> <nullable> |
null | On 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 |
string |
<optional> <nullable> |
null | Arbitrary reference data the integrator can share with verification scripts. Has no effect in mobile app environment. Defaults to null. |
- Source:
Throws:
error if the supplied partner is undefined or null.
Members
(nullable) contentUrl :string
Type:
- string
- Source:
(nullable) customReferenceData :string
Type:
- string
- Source:
(nullable) serviceWindow :Window
If not null, the window to which service communication should be
directed, overriding the default search algorithm.
Type:
- Window
- Source:
(nullable) slotElement :HTMLElement
Type:
- HTMLElement
- Source:
underEvaluation :boolean
Whether 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.
Type:
- boolean
- Source:
(nullable) videoElement :HTMLVideoElement
Type:
- HTMLVideoElement
- Source:
Methods
setServiceWindow(serviceWindownon-null)
By 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.
Parameters:
Name | Type | Description |
---|---|---|
serviceWindow |
Window | The window containing the OMID Service Script. |
- Source:
setSlotElement(slotElementnullable)
Specifies the ad creative HTML element within the WebView.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
slotElement |
HTMLElement |
<nullable> |
The ad creative DOM element. |
- Source:
setVideoElement(videoElementnullable)
Specifies the video element within the WebView.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
videoElement |
HTMLVideoElement |
<nullable> |
The video element. |
- Source: