rememberErrorState

Creates an ErrorState that's remembered across compositions.

The error is only captured from the player's error event, so create this state before an error can happen. For example, create it at the top of your UI and pass it down to the error overlay, instead of creating it inside the error overlay that is only shown once there's an error.