David
David

Reputation: 382

detect end of song - SoundJS

I am using SoundJS to play music. How can I detect when a song has ended?

SoundJS can detect events, is there an event for when a song ends? something like this:

var songInstance = createjs.Sound.play("sound");
songInstance.on("_SONG_ENDED_", function(){
     //do something after song has ended
});

Upvotes: 1

Views: 1212

Answers (1)

Thomas Juranek
Thomas Juranek

Reputation: 343

I think you can do the below code based off this site: http://createjs.com/docs/soundjs/classes/Sound.html

instance.on("complete", this.handleComplete, this);

Upvotes: 4

Related Questions