As I saw, this is a common problem on android since 2011. It's annoying just because not only youtube videos are unable to play, but somehow also some system sounds are becoming mutted, including alarm sound (alarm is displaying, but without any sounds). Even when creating a new alarm, while choosing alarm tone you cannot preview that. And it doesn't matter if you are using stock alarm or a downloaded alarm app. I was late for my work for 2 times because of that. For two weeks I'm trying to find out why it happens, and that's what i've noticed:
1. It doesn't matter if your phone is at charging or not.
2. It doesn't matter if your dnd is on or off.
3. If force closing all background apps - it starts working.
So, i've uninstalled dozens of useless apps from my phone, and nothing helped. Till I got the facebook app and messenger deleted. I've noticed that it can be because of them, because one night I've received a message on messenger, and in the morning my alarm was running silently. For two days everything seems to be ok.
Phone is Galaxy S7.
Hope this will help you too.