ktvPlayer$onPlayStateChanged$state$error method

FutureOr<void> ktvPlayer$onPlayStateChanged$state$error(
  1. ByteRTCKTVPlayer ktvPlayer,
  2. NSString musicId,
  3. ByteRTCPlayState state,
  4. ByteRTCKTVPlayerErrorCode error,
)

@detail callback @author lihuan.wuti2ha @brief Music playing state changed callback. @param ktvPlayer Current ktvPlayer. See ByteRTCKTVPlayer{@link #ByteRTCKTVPlayer}. @param musicId Music ID. @param state Music playing status. See ByteRTCPlayState{@link #ByteRTCPlayState}. @param error Error code. See ByteRTCKTVPlayerErrorCode{@link #ByteRTCKTVPlayerErrorCode}. @note You will receive this callback on following events.
- When you successfully start playing music by calling playMusic:audioTrackType:audioPlayType:{@link #ByteRTCKTVPlayer#playMusic:audioTrackType:audioPlayType}, you will receive this callback with ByteRTCPlayStatePlaying playState. Otherwise the playState will be ByteRTCPlayStateFailed. - If the music with the same music ID is playing when you call playMusic:audioTrackType:audioPlayType:{@link #ByteRTCKTVPlayer#playMusic:audioTrackType:audioPlayType} again, the music will restart from the starting position, and you will receive this callback with ByteRTCPlayStatePlaying playState to inform the latter music has started. - When you successfully pause the music by calling pauseMusic:{@link #ByteRTCKTVPlayer#pauseMusic}, you will receive this callback with ByteRTCPlayStatePaused playState. Otherwise the playState will be ByteRTCPlayStateFailed. - When you successfully resume the music by calling resumeMusic:{@link #ByteRTCKTVPlayer#resumeMusic}, you will receive this callback with ByteRTCPlayStatePlaying playState. Otherwise the playState will be ByteRTCPlayStateFailed. - When you successfully stop the music by calling stopMusic:{@link #ByteRTCKTVPlayer#stopMusic}, you will receive this callback with ByteRTCPlayStateStoped playState. Otherwise the playState will be ByteRTCPlayStateFailed. - When the music ends, you will receive this callback with ByteRTCPlayStateFinished playState.

Implementation

FutureOr<void> ktvPlayer$onPlayStateChanged$state$error(
    ByteRTCKTVPlayer ktvPlayer,
    NSString musicId,
    ByteRTCPlayState state,
    ByteRTCKTVPlayerErrorCode error) async {}