This appears to be the fix that worked for me. Galaxy S10+. When the screen went to lock Spotify would pause randomly. Sometimes it would start again, sometimes not. Widgets and other controls would not work.
"If you go to Apps > Spotify > Optimize battery usage, Spotify will continue playing after you've clicked the power button to sleep the display. However, if you allow the display to time out and sleep on its own, Spotify will continue to shut off when the display sleeps."
Dude your a legend. Keep the camera on. What a load of eeejits. My battery ran out last night and it put spotify to sleep. You've save me from Burning my headphones phone and leaving spotify completely
I confirm this happens on a brand new Samsung A50 on Adndroid version 9. Very annoying. As soon as the phone sleeps, any music playing stops. If I tap the screen so that the lock screen displays, the music starts playing again. I tried delete cache, restart, uninstall spotify, reinstall spotify, use offline music. None of it works, it has to be a software issue either Spotify / Samsung / or both.