Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Glomex / Ant1 / Breakdown
var adSchedule = {
start: 3251,
'20s': 3252,
'30s': 3253,
end: 3254
};
var parseAdSchedule = function (adSchedule) {
var result = {};
for (var key in adSchedule) {
result[key] = {
type: 'linear',
tags: ['http://adman.antenna.gr/gbanner/?' + (+new Date()) + '|' + adSchedule[key]
+ '/1x1?' + (Math.round((Math.random() * 90000))) + ':=1441788668@1920x1200x32?/&cap=abp&frametag='
+ (key === 'start' ? 'preroll' : (key === 'end' ? 'postroll' : 'midroll'))
+ '/testcookie1']
}
}
return result;
}
glomex.init(domNode, 'iofs1vux')
.onGlomexPlayer(function(player) {
player.setAdScheduler({
get: parseAdSchedule.bind(null, adSchedule),
update: function(adSchedule) {
return Promise.resolve(adSchedule);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment