Skip to content

Instantly share code, notes, and snippets.

@foliovision
Last active October 11, 2016 15:11
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 foliovision/1fec01e5ca8cb2a6a03d to your computer and use it in GitHub Desktop.
Save foliovision/1fec01e5ca8cb2a6a03d to your computer and use it in GitHub Desktop.
FV Player VAST - custom tracking
if( typeof(jQuery) != "undefined" ) {
jQuery('.flowplayer').on('load', function(e,api) {
if( typeof(api) != "undefined" && typeof(api.fv_player_vast_custom_tracking) == "undefined" ) {
api.fv_player_vast_custom_tracking = true;
console.log('FV VPAID vload');
}
} ).on('fv_vpaid_requested', function() {
console.log('FV VPAID adrequest');
} ).on('fv_vpaid_started', function() {
console.log('FV VPAID adstart');
} ).on('fv_vpaid_completed', function() {
console.log('FV VPAID adcomplete');
} ).on('fv_vpaid_loaderror fv_vpaid_playbackerror', function(e,element) {
var api = jQuery(this).data('flowplayer');
if( typeof(api.fv_player_vast_loaderror_count) == "undefined" ) {
api.fv_player_vast_loaderror_count = 1;
} else {
api.fv_player_vast_loaderror_count++;
}
if( api.fv_player_vast_loaderror_count == fv_vast_conf.ads.length ) {
console.log('FV VPAID no ad loaded at all!');
}
} );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment