mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 02:28:31 +01:00
2b567de5c1
closes #652
16 lines
367 B
JavaScript
16 lines
367 B
JavaScript
function playSound(path) {
|
|
// audio supported?
|
|
if (typeof window.Audio === 'function') {
|
|
var audioElem = new Audio(path);
|
|
|
|
audioElem.play().catch(function(){
|
|
debugger;
|
|
})
|
|
}
|
|
}
|
|
|
|
function playRandomSound(){
|
|
var sound = srvModel.sounds[Math.floor((Math.random() * srvModel.sounds.length) )];
|
|
playSound(sound);
|
|
}
|