Solution 1 :

as in the comments mentioned, you can go on with the socket principles. Basically for me the choice was in nodejs. With this I wrote a chat application. As you know it is almost the same pattern with your use case. I had to broadcast the messages to all the clients in the same chat group. has also a client library, where you can listen to events. You can define your own event and broadcast them to clients which are listening to the event and the socket.

Good luck!

Problem :

function play(){
          var audio = document.getElementById("sound");
; }

<button onclick="play()">Press</button>

<audio id="sound" src="123.mp3" ></audio>

What I want to do is to play sound for everyone who’s currently on website. Is this possible? Which language or method should I search for?

PS. This is my second try to ask question correctly, hope I did it right this time.


Comment posted by Kiksen

Hi. For doing something like this you would need a server to connect to. For example WebSockets. This way you could tell the server, to broadcast a message to all the users of the site.

Comment posted by

Comment posted by