-
Notifications
You must be signed in to change notification settings - Fork 259
Play sound new notif #65
Comments
Nice one @alexey13 and good idea.. what happens if you receive a lot of messages at once? Do you debounce this call or something? |
You mean user send to another user messages one by one? No, not debounce. Interesting scenario, need to test it in real life. When I use chat on a desktop and hear the sound (whatsapp desktop using sound) I focus on the chat window, if I do not want to hear the sound I just turn it off in that window of a browser. |
But I think debounce nice idea. For example 1 sound in 3 seconds |
I think this one we can use https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events |
Nice.. well maybe with a slightly shorter sound and checking to see if we are already playing a sound we could make this work. |
var audio = new Audio();
audio.preload = 'auto';
audio.src = '/path';
audio.play();
const notification = new Notification(...
I used this one https://freesound.org/people/Thoribass/sounds/253595/
Convert to mp3
The text was updated successfully, but these errors were encountered: