我在我的网站上使用以下代码来显示通知(桌面通知)
new Notification('Testing Sound', {'body':'Playing Sound', 'sound':'https://mywebsite/assets/mysound.wav'});
我在Firefox中,通知工作正常,但问题在于声音。它正在播放我的mac通知的默认声音,而不是我在构造函数中给出的声音路径。
我错过了什么吗?你能帮我找一下这个问题的原因吗?
答案 0 :(得分:1)
根据MDN,截至2015年12月,任何浏览器均不支持Notification.sound; https://developer.mozilla.org/en-US/docs/Web/API/Notification/sound