The question of whether the Player or ExoPlayer component works in the background (idle / sleep mode) when the sound is streamed has often been discussed (in the Kodular and AI2 forum).
The answer is definitely no, at least not in all cases. With some Samsung devices in particular, it definitely does not work without using a Foreground service (not even with the Battery optimizations extension).
I have tested this intensively and extensively on dozens of devices and all Android versions and read almost every post in all relevant forums. We also discussed this topic in the AI2 Power User forum with the MIT team without a result / solution.