mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

The new `currentPlayer` was only used to check the available command. It should also be used for setting and clearing the Surface. The PlayerSurface was still behaving correctly, perhaps due to the lambda being reevaluated with the new player (since `currentPlayer` is of type MutableState). Which meant it was also using the latest `player` that `PlayerSurface` was recomposed with (in the argument), rather than holding onto the original object. PiperOrigin-RevId: 713264041