when playing songs on spotify and then switching to say chrome and trying to play youtube video, you generally pause spotify. but when i pause spotify the audio on my mac goes away. the volume is fine, youtube video is playing but there is no audio output. to fix this, i have to change audio source on my mac from say 'internal speakers' to desktop/wireless headphones and then back to internal speakers. This behaviour happens whether my current/actual output is internal speakers or any wireless headphones. I have to manually change audio sources back and forth to get volume. If during this error state i go from pause to unpause/resume state again, i can hear both youtube and spotify together.
This issue is not just related to youtube. any other video or audio i try to listen to on any browser (chrome, firefox) i have the same issue. its super annoying.
This sounds like an issue with your computer rather than Spotify since Spotify can't control other content on your computer, such as Youtube. I would recommend you look into getting tech support from where you purchased your computer, or that you take it into an Apple store to get checked out.