I had tried all of the solutions posted but still had the problem of my phone shutting off while streaming a readio station through Tune in Radio App. What ended up working for me is to go into Settings > Optimize Battery Usage > Click down arrow that says "apps not optimized" and select all > turn off the app you are streaming with. I am now able to stream the station without the app shutting down.
What worked for me was going to bluetooth, details, gear sign, and unpairing then repairing my bluetooth device.
UPDATE Nevermind it seems to still be pausing music albeit a lot less now. It was working fine until I installed system update 11 on my S9.
Generally speaking, you can't do much with Android OS BUT for Samsung devices, there's an amazing solution
Download Samsung Sound Assistant
Go to Control Audio, enable Dual app sound and then select your favorite Music app
And voila! your app won't pause and notifications will be play along your music without even lowering the volume of music
Same problem just a few minutes ago on S7 edge... it's not just on s9 or s8
The music was stopping and then starting again every second.. and then when it stopped the Google assistant showed up... this was very frustrating so I deactivate Google and put my phone on airplane mode because I thought that one app was doing this over the internet. And it didn't work.. so idk
I had this issue with audible. It kept shutting down everytime the screen went to sleep. The only way to listen to audible was to put car mode on and force the screen to stay on which drains the battery.
I found an option in battery settings. "Sleeping Apps" Basically any app in this section won't work when the phone screen shuts down. I removed audible from the list and fixed the problem. It now works
Just an FYI my S9 plus music player started stopping after half of a song played. I finaly figured out my issue related to play lists. I deleted all my playlists and created new lists. This resolved my issue.
I am having the same issue but I have a Samsung A8 (2018) updated to the very latest software update (within the last couple of days) although now this update breaks Bluetooth so another issue.
Ok back to this one though, I have tried around 5 music player apps and all do the same, randomly stop playing but strangely it will only do this when I have placed my phone in my pockets, I have checked phone locks etc etc to see if anything has knocked the stop/play button etc but nothing, when the phone is out of my pocket, I have not noticed it stopping, like I said I have checked, pulled phone out, checked all buttons to see if anything could press a button or knock the play button but the phone remains locked (even volume keys are fine and at the same volume) its frustrating as it was working perfectly before the previous update (Pie 9)