Hi!
I have the same issue too..!
It happens only when I'm using my bluetooth headset, regular wired headphones cause no issue.
And it doesn't matter if the screen goes to sleep or not, because it happened very often even when I'm staring at the app in question.
The media plays for a few seconds and pauses (stopping in case of music players). I keep resuming the playback a few times until I get tired of doing it or sometimes (if I'm lucky) it sets itself right mysteriously.
Any kind of help please..?
Edit: I have a Moto G4 Plus running Nougat (September security patch)