How to Embed an Auto Playlist

 

Auto Playlist Configuration

Auto Playlist (MAXi) consists of 2 components:

  1. Publisher’s specific configuration
  2. Execution script reference

Both should be added to publisher’s site template in <head> section

It is strongly recommended to transpile inner javascript section in order to support older browsers online babel transpiler

 


/** JSDoc:


* @param {Object} maxConfig - main config object, must defined on `window` object
* @param {Object} maxConfig.global - A global object that control on player and defines customer requirements
* @param {Object} maxConfig.global.player - player object, this object will setup a new player for this customer
* @param {String} maxConfig.global.player.pid - player id
* @param {String} maxConfig.global.player.bcid - player buyer company id
* @param {Number} [maxConfig.global.onLoadTimeout=10] - on load timeout delay in milliseconds
* @param {Number} maxConfig.global.template - customer's template to insert / wrap the player when strategy is passed
*
* @typedef {Object} Strategy
* @param {Array<Strategy>} maxConfig.strategies
* @property {String} Strategy.type - INSERT | REPLACE
* @property {String} Strategy.position - beforebegin | afterbegin | beforeend | afterend . (ReadMore)[https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentElement#Parameters]
* @property {Boolean} Strategy.injectIfPlayerAlreadyExists - when true, will inject MAXi when there is already player (any) in this page.
* @property {String} Strategy.cssSelector - Where should inject MAXi in this page. (must compatible with real selector)
* @property {Function} Strategy.conditionFunc - when this function will return true, this strategy will work.
**/

 

Example (also in attached JS file):

mceclip0.png

 

 

Have more questions? Submit a request