btcpayserver/BTCPayServer/wwwroot/crowdfund/services/audioplayer.js

16 lines
367 B
JavaScript
Raw Normal View History

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);
}