Disable notifications when other audio is playing I have a Sony Xperia Z1 with 4.4.2 Kitkat

Is possible disable the sound of the notifications when I listen music or doing something?

I'm watching a video of youtube, listen music with headphones ( device is silent), etc. but when telegram or whatsapp receive a notification it sounds. If i disable the media volume i can't listen the video or the music

I know that other devices have the option to disable notifications.
You can goto Settings-&gt;Sound-&gt;Volumes-&gt;Ringtone&amp;Notification and reduce the volume. 

(or) You can press the volume down button to disable notification and then start listening to media.