mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 04:10:27 +08:00
增加备用音频
This commit is contained in:
BIN
web/public/audios/alert.ogg
Normal file
BIN
web/public/audios/alert.ogg
Normal file
Binary file not shown.
@@ -1047,6 +1047,20 @@ window.teaweb = {
|
||||
}
|
||||
})
|
||||
return isOk
|
||||
},
|
||||
playAlert: function () {
|
||||
let audioBox = document.createElement("AUDIO")
|
||||
audioBox.setAttribute("control", "")
|
||||
audioBox.setAttribute("autoplay", "")
|
||||
audioBox.innerHTML = "<source src=\"/audios/alert.ogg\" type=\"audio/ogg\"/>";
|
||||
document.body.appendChild(audioBox);
|
||||
audioBox.play().then(function () {
|
||||
setTimeout(function () {
|
||||
document.body.removeChild(audioBox);
|
||||
}, 2000);
|
||||
}).catch(function (e) {
|
||||
console.log(e.message);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user