Last active
October 11, 2016 15:11
-
-
Save foliovision/1fec01e5ca8cb2a6a03d to your computer and use it in GitHub Desktop.
FV Player VAST - custom tracking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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