I checked this again several times. It definitely doesn’t work on a Galaxy Note8 (Android 9) when screen is off (in standby / idle mode) and I’m pretty sure it won’t work on an S8 (Android 9) either. Otherwise, please show the power options (battery settings of your device ) so that I can test them on my device.
I was able to largely prevent the problem of stuttering and later stopping by triggering the every 500 ms with a timer.
But the app still stops after 6-20 minutes; cannot be predicted. And if you bring the app to the foreground, the app is stopped (the play button) shows: “Play”.
So let my test app (Screen1 and Screen2) run for 20 min and report.
ExoPlayer_test2.apk (5.9 MB)