My suggestion is go to -> settings -> sound and vibrations -> seperate app sound
If you have that option that is, you will be able to choose what app sounds goes to the Bluetooth Device.
Also YouTube stops the audio when the phone goes to standby. (Premium YouTube can continue while the phone is in standby)
Also Also the app may override the audio playback when other audio apps is in use etc.
Just another tip if you have a video playing with the standard video app player, there is a setting option to be able to play the "video" while the phone is in standby.