diff --git a/player/ad-event-verification-omsdk/index.html b/player/ad-event-verification-omsdk/index.html index 1b9075f1..0a11cb34 100644 --- a/player/ad-event-verification-omsdk/index.html +++ b/player/ad-event-verification-omsdk/index.html @@ -13,7 +13,7 @@ -
+
@@ -30,14 +30,12 @@ Partner Name -
-
@@ -46,21 +44,18 @@
- - - - - + +
-
-
+
Event Log @@ -70,62 +65,61 @@

-
-
-

- Getting Started Guide -

-
-
-

- 1. Acquire the OM SDK files from the - - IAB Tech Lab Tools Portal +

+
+

+ Getting Started Guide +

+
+
+

+ 1. Acquire the OM SDK files from the + + IAB Tech Lab Tools Portal + +

+

+ 2. Include the following scripts in your page +

+
    +
  • + OM SDK Scripts: Service Script and JS Session Client +
  • +
  • + Bitmovin Player Scripts including the Bitmovin Advertising module (BAM) and the Advertising OM SDK module +
  • +
+
+
+ ${code:page.html} +
+
+

+ 3. Set up the player instance for ad verification using OM SDK +

+
    +
  1. + Add player modules to player core +
  2. +
  3. + Create a player configuration including a + + OM SDK Tracker configuration -

    -

    - 2. Include the following scripts in your page -

    -
      -
    • - OM SDK Scripts: Service Script and JS Session Client -
    • -
    • - Bitmovin Player Scripts including the Bitmovin Advertising module (BAM) and the Advertising OM SDK module -
    • -
    -
-
- ${code:page.html} -
-
-

- 3. Set up the player instance for ad verification using OM SDK -

-
    -
  1. - Add player modules to player core -
  2. -
  3. - Create a player configuration including a - - OM SDK Tracker configuration - -
  4. -
  5. - Instantiate the player with above configuration, load a source & play -
  6. -
-

- Note: The configured - - validationScriptUrl - - , among other things, defines which ad tracking events should subscribed to and the location of the verification server to report to. -

-
-
- ${code:page.js} -
+ +
  • + Instantiate the player with above configuration, load a source & play +
  • + +

    + Note: The configured + + validationScriptUrl + + , among other things, defines which ad tracking events should subscribed to and the location of the verification server to report to. +

    +
    +
    + ${code:page.js}
    - +
    diff --git a/player/ad-event-verification-omsdk/js/script.js b/player/ad-event-verification-omsdk/js/script.js index ac4eedbd..cc75ea3b 100644 --- a/player/ad-event-verification-omsdk/js/script.js +++ b/player/ad-event-verification-omsdk/js/script.js @@ -1,3 +1,4 @@ +var adTag = 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=' + Date.now(); var conf = { key: '29ba4a30-8b5e-4336-a7dd-c94ff3b25f30', playback: { @@ -6,7 +7,7 @@ var conf = { advertising: { adBreaks: [{ tag: { - url: `https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=${Date.now()}`, // TODO: + url: adTag, type: 'vast' }, position: 'pre', @@ -66,9 +67,9 @@ function clearError(message) { $('#validationscripturl-input').on('input', function(e) { if (e.target.value) { - $('#event-log').hide(); + $('#event-log-row').hide(); } else { - $('#event-log').show(); + $('#event-log-row').show(); } }); @@ -144,11 +145,11 @@ function setupPlayer(conf, source) { var player = new bitmovin.player.Player(playerContainer, conf); player.on('error', function(e) { - displayError(`Error: ${e.code}/${e.name}`); + displayError('Error: ' + e.code + '/' + e.name); }); player.on('aderror', function(e) { - displayError(`Ad Error: ${e.message} (potentially caused by ad blocker)`); + displayError('Ad Error: ' + e.message + ' (potentially caused by ad blocker)'); console.warn(e); }); @@ -157,22 +158,39 @@ function setupPlayer(conf, source) { } function injectScript(src) { - return new Promise((resolve, reject) => { + return new Promise(function(resolve, reject) { const script = document.createElement('script'); script.src = src; script.addEventListener('load', resolve); - script.addEventListener('error', e => reject(e.error)); + script.addEventListener('error', function(e) { + reject(e.error) + }); document.head.appendChild(script); }); } +function isIe() { + return /MSIE|Trident/.test(navigator.userAgent); +} + +function isEdgeLegacy() { + return /Edge\/18/.test(navigator.userAgent); +} + $(document).ready(function() { renderjson.set_icons('+ ', '- '); + if (isIe() || isEdgeLegacy()) { + displayError('Sorry! This demo is not supported on Internet Explorer and Edge Legacy web browsers.'); + document.querySelector('#player-row').classList.add('d-none') + document.querySelector('#event-log-row').classList.add('d-none') + return; + } + Promise.all([ injectScript('https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-advertising-bitmovin.js'), injectScript('https://cdn.bitmovin.com/player/web/8/modules/bitmovinplayer-advertising-omsdk.js') - ]).then(() => { + ]).then(function() { bitmovin.player.Player.addModule(bitmovin.player['advertising-bitmovin'].default); bitmovin.player.Player.addModule(bitmovin.player['advertising-omsdk'].default); player = setupPlayer(conf, source);