Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Unique - controls the detection of whether this player runs more than once.

  2. Find Win - controls if the player should run in the same document as the script of above it (e.g. parent or top).

  3. Post Create - a usually empty placeholder that runs after the player’s main DIVs are created.

  4. Retry - controls what happens when the player tries to re-activate itself after failures.

  5. Create - controls the creation of the player’s main DIVs.

  6. Position - controls where to place the player inside the page.

  7. Load - controls the external calls to the player’s core.

  8. Post Start - a usually empty placeholder that runs after the player has finished its initial loading.

  9. Get Attribute - controls the pull of attributes from the script’s GET parameters.

  10. Start - starts the player object.

  11. Pre Run - a usually empty placeholder that runs before the player runs.

  12. Run - controls the initially loading of the player.

  13. Target - checks if the player runs in Desktop or Mobile.

  14. Track - controls how the player tracks with pixels its internal flow.

  15. Fetch Content - an InStream only event that fetches from the CMS for players that use it.

  16. Init - reserved for future usage.

Position Function

to have more than one selector option,

  1. go to ‘OVERRIDE FUNCTIONS’ - > ‘Position’ → insert the below function instead of the exist function

    Image Removed
  2. add with comma and space after it “, ” more selectors.

    Image Removed
Code Block
languagejs
   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));
        }
    }