...
Unique - controls the detection of whether this player runs more than once.
Find Win - controls if the player should run in the same document as the script of above it (e.g. parent or top).
Post Create - a usually empty placeholder that runs after the player’s main DIVs are created.
Retry - controls what happens when the player tries to re-activate itself after failures.
Create - controls the creation of the player’s main DIVs.
Position - controls where to place the player inside the page.
Load - controls the external calls to the player’s core.
Post Start - a usually empty placeholder that runs after the player has finished its initial loading.
Get Attribute - controls the pull of attributes from the script’s GET parameters.
Start - starts the player object.
Pre Run - a usually empty placeholder that runs before the player runs.
Run - controls the initially loading of the player.
Target - checks if the player runs in Desktop or Mobile.
Track - controls how the player tracks with pixels its internal flow.
Fetch Content - an InStream only event that fetches from the CMS for players that use it.
Init - reserved for future usage.
Position Function
to have more than one selector option,
go to ‘OVERRIDE FUNCTIONS’ - > ‘Position’ → insert the below function instead of the exist function
add with comma and space after it “, ” more selectors.
Code Block | ||
---|---|---|
| ||
var p = this.doc;
var isScp = false;
if (a.posSelector) {
p = null;
var selector = a.posSelector.split(','),
posType = a.posType,
selector_active,
posType_active;
for (var i = 0; i < selector.length; i++) {
selector_active = selector[i].trim();
posType_active = posType;
try {
selector_active = selector_active.split('@', 2);
if (selector_active.length == 2) {
if (["in", "after", "before"].indexOf(selector_active[1]) && posType_active != selector_active[1]) {
posType_active = selector_active[1];
}
selector_active = selector_active[0];
}
var q = this.doc.querySelectorAll(selector_active);
var l = 0;
if (a.posCounter > 0) {
l = a.posCounter - 1;
}
p = q[l] ? q[l] : null;
if (p) {
const rect = p.getBoundingClientRect();
a.posSelector = selector_active;
a.posType = posType_active;
break;
}
} catch (e) {
this.track("AV_M3", "&prbdres=badpos&sn=" + encodeURIComponent(location.href).slice(0, 400));
return;
}
}
if (!p) {
this.retry();
return;
}
}
if (a.posDfp1x1 && window.frameElement) {
n = window.frameElement.parentNode.parentNode;
p = n.parentNode;
if ((frameElement.clientHeight > 5 || document.body.clientHeight > 5) && !a.nohideIframe) {
frameElement.style.height = "0px";
}
if (a.posType == "after") {
n = n.nextElementSibling;
}
}
var n;
if (p === this.doc) {
n = this.doc.getElementById(a.scriptId);
if (n) {
n.id += "-used";
p = n.parentNode;
}
}
if (p === this.doc.head) {
n = null;
p = this.doc;
}
if (a.posType && a.posType !== "in" && !n) {
if (a.posType === "after" && p.nextElementSibling) {
n = p.nextElementSibling;
} else {
n = null;
}
p = p.parentNode;
}
if (p) {
if (!p.av_setpos) {
p.av_setpos = {};
}
if (!p.av_setpos[a.position]) {
p.av_setpos[a.position] = true;
a.position += "-" + Date.now();
this.create(p, n);
this.load();
} else {
this.track("AV_M3", "&prbdres=duppos&sn=" + encodeURIComponent(location.href).slice(0, 400));
}
} |