Hacker News new | past | comments | ask | show | jobs | submit login

If playing the sound isn't latency sensitive, you could just have each tab pick a random delay [1].

When the tabs receive the event, they each wait X milliseconds. The first timer to expire marks the event as "played". Other tabs receive this event, and abort their timers.

If a "leader" disappears, it will simply fall to a tab with a larger delay.

[1] Something like, rounded to 50ms increments, in a range, 100 - 1000ms. Avoiding collisions / ensuring uniqueness is left as an exercise for the reader.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: