Same issue. S9+, recently started having the issue. YouTube randomly minimizes to floating box when in full screen and charging. Netflix randomly behave like the screen is being pressed, but they don't minimize.
I'm having the same issue across all my streaming services and my mobile game... it keeps pausing it and causing me to lose online, also YouTube minimizes my GPS minimizes while driving causing me to almost get lost.. also netflix glitch with a quick pause as if like you said it minimized... I called Samsung they suggested factory reset and after reading the comments it, doesnt work so I'll be call back and give them an ear full.
Can you check to see how much space is left on your phone not your micro SD? I am wondering if it's local storage space issues for RAM. So S9+ 6GB Ram you need at least 6GB plus some space for media stream cache. Just a theory but maybe you can check.
I am fed up with Samsung because of this bulls*** issue. I work for a company that sells their phones and I discourage customers from buying Samsung because of not only this issue but many others, including being overpriced.