Android pie 9 music stop when minimize
As per the question, it doesn't look like the phone's default music player supports background play feature. You can use third-party apps like VLC Media Player to play music in the background (when minimized).