Fly-player (via JS API)

Fly (Sticky) player is always on top of the screen.

Player appears in article but when is scrolled out from the screen is becoming small and sticks to any place of the screen.

Benefits:

  • High viewability 
  • High ads view depth
  • High video ads inventory
  • Can be work both Desktop & Mobile, setup separately

You can turn on fly mode two ways:

  • Via Settings > Presets
  • Via Javascript API (this article)



How to Activate Player via Javascript API

To turn on Fly-Mode


First of all you need to create a player:

Init
var start = function(VIQEO) {
  // Here will be setup code
}
if (!window.VIQEO) {
  window.onViqeoLoad = start;
} else {
  start(VIQEO);
}


You have to put the code below inside of function to setup Fly player:

Setup Always-on-top mode
VIQEO.setConfig({ flyPlayer: true }) 


With the code above 1st player on the page will be set up as Fly player with default settings.

To set up the style and position of the player you can details :


Setting up the player
VIQEO.setConfig({
  flyPlayer: {
    floatingWidth: 230, // Width of the floating player
    floatingTop: '', // Offset from the top, px||%
    floatingRight: '', // Offset from the right, px||%
    floatingBottom: '', // Offset from the bottom, px||%
    floatingLeft: '', // Offset from the left, px||%
    enableCloseButton: false // Show close button, true || false
  }
})


The example below put the floating (sticky) player to the top left corner with offset 30px from the top & 30px from the left:

Example
VIQEO.setConfig({ 
  flyPlayer: { floatingTop: 30, floatingLeft: 30 }
})