You will have to include the AdvertisingOmSdk module into the player before creating an instance.

Example


<script type="text/javascript" src="./bitmovinplayer.js"></script>
<script type="text/javascript" src="./modules/bitmovinplayer-advertising-bitmovin.js"></script>
<script type="text/javascript" src="./modules/bitmovinplayer-advertising-omsdk.js"></script>
<!-- your html body here -->
<script type="text/javascript">
bitmovin.player.Player.addModule(bitmovin.player['advertising-bitmovin'].default);
bitmovin.player.Player.addModule(bitmovin.player['advertising-omsdk'].default);
var conf = {
key: '<yourPlayerKey>',
advertising: {
adBreaks: [{
tag: {
url: '<http://location-of-your-ad.xml>',
type: 'vast'
},
position: 'pre',
}],
trackers: {
omSdk: {
partnerName: '<yourOmSdkPartnerName>',
partnerVersion: '<yourOmSdkParnterVersion>',
},
}
},
};
var player = new bitmovin.player.Player(document.getElementById('player'), conf);
interface OmSdkTracker {
    contentUrl?: string;
    onAccessMode?: ((ad) => OmSdkAccessModeRules);
    partnerName: string;
    partnerVersion: string;
    serviceWindowProxy?: "top" | "parent" | "self";
    verificationResources?: VerificationResource[];
}

Properties

contentUrl?: string

Allows you to customize the current content url used. This can be useful when the same urls with different parameters need to be included under the same content url for easier tracking.

If the content url is not provided the default current href will be used.

onAccessMode?: ((ad) => OmSdkAccessModeRules)

By default accessMode will be set as AccessMode.FULL for all requests if nothing is provided.

Type declaration

Example


const rules: OmSdkAccessModeRules = {
limited: [new RegExp('examplevendor1\.com/.*$')],
full: [/examplevendor2\.com/],
}
const omSdkTracker: OmSdkTracker = {
onAccessMode: _ad => rules,
...
}
partnerName: string

The partner name associated with your OM SDK account

partnerVersion: string

The version associated with your OM SDK account

serviceWindowProxy?: "top" | "parent" | "self"

By default, the OM SDK Session Client Library will assume the Service Script is present in the same frame the library is loaded in. Use this config to override the behavior. Default is top to indicate that window.top shall be used.

verificationResources?: VerificationResource[]

By default it will use an empty array. Allows loading of verification urls.

Example


const adConfig: AdvertisingConfig = {
adBreaks: [
// your ads here
],
trackers: {
omSdk: {
partnerName: '<yourOmSdkPartnerName>',
partnerVersion: '<yourOmSdkParnterVersion>',
verificationResources: [
{
validationScriptUrl:
'./Validation-Script/omid-validation-verification-script-v1.js',
},
],
},
},
};

Generated using TypeDoc