Guest User

Untitled

a guest
Aug 25th, 2019
97
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function init_amedia_tracking(video) {
  2. var EVENTS = flowplayer.events;
  3. var AD_EVENTS = flowplayer.AdEvents || { AD_STARTED: "ad-started", AD_COMPLETED: "ad-completed", AD_SKIPPED: "ad-skipped", AD_BREAK_COMPLETED: "ad-break-completed" };
  4. video.on(
  5. [
  6. 'view'
  7. , 'display'
  8. , EVENTS.ENDED
  9. , EVENTS.SEEKED
  10. , EVENTS.SEEKING
  11. , EVENTS.PAUSE
  12. , EVENTS.PLAYING
  13. , EVENTS.VOLUME_CHANGE
  14. , AD_EVENTS.AD_STARTED
  15. , AD_EVENTS.AD_COMPLETED
  16. , AD_EVENTS.AD_SKIPPED
  17. , AD_EVENTS.AD_BREAK_COMPLETED
  18. , EVENTS.CLICK
  19. , EVENTS.TOUCHEND
  20. , EVENTS.FULLSCREEN_ENTER
  21. , EVENTS.FULLSCREEN_EXIT
  22. ],
  23. function(e) {
  24. parent.postMessage("player::" + e.type, window.parent)
  25. console.log('amedia event', e.type, video.opts.metadata);
  26. }
  27. )
  28. }
  29.  
  30. //player in iframe is available under window.ovp_player
  31. init_amedia_tracking(window.ovp_player);
RAW Paste Data