3
所以我試圖測試出使用Howler.js播放音頻文件。當我運行這個html文件並按下按鈕時,在控制檯中出現錯誤,提示「源文件數組必須通過任何新的哈爾傳遞。」Howler.js錯誤:'一個源文件數組必須通過任何新的哈爾'
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Play Sound</title>
<script src='./howler.js/dist/howler.js'></script>
</head>
<body>
<button id="btn">Play</button>
<script>
var pong = new Howl({urls: ['sound.mp3', 'sound.ogg']});
document.getElementById('btn').onclick=function(){pong.play();}
</script>
</body>
</html>