onStateChanged

Occurs when the player state changes.

virtual void onStateChanged(PlayerState old_state, PlayerState new_state,
                    rte::Error *err) = 0;
Since
v4.5.0

To monitor player events, you need to call RegisterObserver to register a player observer object.

Trigger timing

When the player state changes, the SDK triggers this callback the report the previous and current states.

Restrictions

None.

Parameters

old_state
The previous player state. See RtePlayerState.
new_state
The current player state. See RtePlayerState. If the current state is kRtePlayerStateFailed, you can get the detailed error information from the err parameter.
err
The state or error information: Error.