Archived
24 lines
649 B
HTML
24 lines
649 B
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>FMCRAFT Chat notification sound</title>
|
|
</head>
|
|
<body>
|
|
<audio id="sound" src="assets/notification.wav" preload="auto"></audio>
|
|
<script>
|
|
window.playNotification = function () {
|
|
var sound = document.getElementById('sound')
|
|
if (!sound) return
|
|
try {
|
|
sound.currentTime = 0
|
|
var promise = sound.play()
|
|
if (promise && typeof promise.catch === 'function') promise.catch(function () {})
|
|
} catch (err) {
|
|
/* 忽略音频播放失败 */
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|