Skip to content

Instantly share code, notes, and snippets.

@danpastori
Created November 9, 2018 04:19
Show Gist options
  • Save danpastori/e6a76f7302fe07cc3cdbe1787e6d3e4d to your computer and use it in GitHub Desktop.
Save danpastori/e6a76f7302fe07cc3cdbe1787e6d3e4d to your computer and use it in GitHub Desktop.
Run Method When Song Is At Certain Time Amplitude 3.3.1
Amplitude.init({
debug: true,
songs: [
//Add songs here
],
callbacks: {
'time_update': function(){
var currentTime = Amplitude.getSongPlayedSeconds();
if( currentTime > x ){
yourMethodForTime();
}
}
}
});
function yourMethodForTime(){
//Do your function!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment