onPlayStateChanged property

OnPlayStateChangedType? onPlayStateChanged
getter/setter pair

Callback for music playback status change.

You will receive this callback on following events:

  • When you successfully start playing music by calling RTCKTVPlayer.playMusic, you will receive this callback with the playState being playing. Otherwise the playState will be failed.
  • If the music with the same music ID is playing when you call RTCKTVPlayer.playMusic again, the music will restart from the starting position, and you will receive this callback with playing playState to inform the latter music has started.
  • When you successfully pause the music by calling RTCKTVPlayer.pauseMusic, you will receive this callback with paused playState. Otherwise the playState will be failed.
  • When you successfully resume the music by calling RTCKTVPlayer.resumeMusic, you will receive this callback with playing playState. Otherwise the playState will be failed.
  • When you successfully stop the music by calling RTCKTVPlayer.stopMusic, you will receive this callback with stopped playState. Otherwise the playState will be failed.
  • When the music ends, you will receive this callback with finished playState.

Implementation

OnPlayStateChangedType? onPlayStateChanged;