Disable notifications while watching videos or listening to music
When you are watching youtube, temporary put your phone on silent.

However you can also use this app: https://play.google.com/store/apps/details?id=com.pierceholdings.dontpause&amp;hl=en