-
-
- Getting Started Guide
-
-
-
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);