Reputation: 20596
I know how to use MediaPlayer.Play(song); to start playing some song/effect.
But how to detect that song/effect ended playing?
Upvotes: 3
Views: 825
Reputation:
You may want to try implementing these two events:
and
An alternate way would be to keep a MediaState variable called "previousState" or whatever, and each Update(), check the previous state for Stopped or Paused, and run whatever code you want in that if. Of course, afterward, update the previous by doing:
previousState = MediaPlayer.State;
Upvotes: 3