onStateChanged

Callback triggered when the player state changes.

virtual void onStateChanged(PlayerState old_state, PlayerState new_state, rte::Error *err) {}
Since
Available since v4.4.0.

If you need to monitor player state changes, you must first call RegisterObserver to register a player observer object.

Trigger Timing

This callback is triggered by the SDK when the player state changes to report the current and previous states.

Parameters

old_state
Previous player state. See RtePlayerState.
new_state
Current player state. See RtePlayerState. If the current state is kRtePlayerStateFailed, you can get detailed error information through the err parameter.
err
State or error information. See Error.