Skip to content

Instantly share code, notes, and snippets.

@phaistonian
Last active July 21, 2016 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phaistonian/9801eb0b267a48b716ab7d10ebca3b97 to your computer and use it in GitHub Desktop.
Save phaistonian/9801eb0b267a48b716ab7d10ebca3b97 to your computer and use it in GitHub Desktop.
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