N
N
Nikita2017-01-24 03:00:46
Google Chrome
Nikita, 2017-01-24 03:00:46

How to make a sound notification in the browser?

Hello, tell me how to make a sound notification in a browser, for example munin or a ticket system, configured to update every 5 minutes. Works exclusively in the browser. When there is a change, the new stash appears. How can I make the browser play the ringtone when this new or new2 or new3 icon appears?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan, 2017-01-24
@jkvint

I didn’t seem to write it to do it by code, right? I asked what are the solutions for this. There is no code, there is an auto-updating page, and an icon when there is new information. So I'll find out what solutions there are for connecting a kind of ringtone when this icon appears, but this needs to be done within my browser, it won't let me go further.

Just because you don't see the code doesn't mean it doesn't exist. There are browser extensions that allow you to connect your scripts to someone else's page. Greasemonkey for example .

O
Oleg, 2017-01-24
@politon

On the event when the hang play icon appears for the sound file I will
add https://jsfiddle.net/Politonius/cwhn7xq9/

A
Andrey, 2017-01-24
@svistiboshka

add a function call to the event on appearance:

//PlaySound('Wat_Metta_Buddha_Qualities.mp3')
function PlaySound(path) {
  var audioElement = document.createElement('audio');
  audioElement.setAttribute('src', path);
  audioElement.play();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question